100 |
100 |
101 class basemanifesttests(object): |
101 class basemanifesttests(object): |
102 def parsemanifest(self, text): |
102 def parsemanifest(self, text): |
103 raise NotImplementedError('parsemanifest not implemented by test case') |
103 raise NotImplementedError('parsemanifest not implemented by test case') |
104 |
104 |
105 def assertIn(self, thing, container, msg=None): |
|
106 # assertIn new in 2.7, use it if available, otherwise polyfill |
|
107 sup = getattr(unittest.TestCase, 'assertIn', False) |
|
108 if sup: |
|
109 return sup(self, thing, container, msg=msg) |
|
110 if not msg: |
|
111 msg = 'Expected %r in %r' % (thing, container) |
|
112 self.assert_(thing in container, msg) |
|
113 |
|
114 def testEmptyManifest(self): |
105 def testEmptyManifest(self): |
115 m = self.parsemanifest(EMTPY_MANIFEST) |
106 m = self.parsemanifest(EMTPY_MANIFEST) |
116 self.assertEqual(0, len(m)) |
107 self.assertEqual(0, len(m)) |
117 self.assertEqual([], list(m)) |
108 self.assertEqual([], list(m)) |
118 |
109 |