tests/test-manifest.py
changeset 32533 d68f3d6bc214
parent 32279 68c43a416585
child 32534 0048a852b6aa
equal deleted inserted replaced
32532:e4f514627514 32533:d68f3d6bc214
   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