Provide TestCase.assertIsInstance for python < 2.7.
[obnox/samba/samba-obnox.git] / python / samba / tests / __init__.py
index 65a727aaf6c606e69ad9b475070b8efb08aeb009..480b2c813524b96e257d113185c54fdc687693e4 100644 (file)
@@ -66,6 +66,10 @@ class TestCase(unittest.TestCase):
         def assertIsNot(self, a, b):
             self.assertTrue(a is not b)
 
+    if not getattr(unittest.TestCase, "assertIsInstance", None):
+        def assertIsInstance(self, a, b):
+            self.assertTrue(isinstance(a, b))
+
     if not getattr(unittest.TestCase, "addCleanup", None):
         def addCleanup(self, fn, *args, **kwargs):
             self._cleanups = getattr(self, "_cleanups", []) + [