summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2015-01-27 03:40:34 +0100
committerAndrew Bartlett <abartlet@samba.org>2015-03-06 04:41:48 +0100
commite3a9feb6984136172616260293130095e19051e2 (patch)
tree836a0bbd395737dfeaebda42b256e4916090d017
parent85c1dc99083598339050ab5326ba9e0766eacdc8 (diff)
downloadsamba-e3a9feb6984136172616260293130095e19051e2.tar.gz
samba-e3a9feb6984136172616260293130095e19051e2.tar.xz
samba-e3a9feb6984136172616260293130095e19051e2.zip
Add custom implementations of TestCase.assertIs and TestCase.assertIsNot, for Python2.6.
Change-Id: I3b806abdaf9540b7c39c961c179c2d2b15d327fe Signed-off-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
-rw-r--r--python/samba/tests/__init__.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/python/samba/tests/__init__.py b/python/samba/tests/__init__.py
index d85260c306..86ec3dff13 100644
--- a/python/samba/tests/__init__.py
+++ b/python/samba/tests/__init__.py
@@ -57,6 +57,14 @@ class TestCase(unittest.TestCase):
def skipTest(self, reason):
raise SkipTest(reason)
+ if not getattr(unittest.TestCase, "assertIs", None):
+ def assertIs(self, a, b):
+ self.assertTrue(a is b)
+
+ if not getattr(unittest.TestCase, "assertIsNot", None):
+ def assertIsNot(self, a, b):
+ self.assertTrue(a is not b)
+
class LdbTestCase(unittest.TestCase):
"""Trivial test case for running tests against a LDB."""