summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2015-01-28 23:17:13 +0100
committerAndrew Bartlett <abartlet@samba.org>2015-03-06 04:41:48 +0100
commitfe231bedecace7e97da22add0cf48f1fd3772544 (patch)
tree305412988599a4b380fe54e1f628c3e1925997af
parentcef4861906633be00cfb91a2d5e38f9870f749f4 (diff)
downloadsamba-fe231bedecace7e97da22add0cf48f1fd3772544.tar.gz
samba-fe231bedecace7e97da22add0cf48f1fd3772544.tar.xz
samba-fe231bedecace7e97da22add0cf48f1fd3772544.zip
Provide TestCase.assertIsInstance for python < 2.7.
Change-Id: Id6d3c8a7dc56cb560eccc3db897a83c638dec7a6 Signed-off-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
-rw-r--r--python/samba/tests/__init__.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/python/samba/tests/__init__.py b/python/samba/tests/__init__.py
index 65a727aaf6..480b2c8135 100644
--- a/python/samba/tests/__init__.py
+++ b/python/samba/tests/__init__.py
@@ -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", []) + [