[PATCH 44/55] Add custom implementations of TestCase.assertIs and TestCase.assertIsNot, for Python2.6.
Jelmer Vernooij
jelmer at samba.org
Fri Feb 6 12:04:16 MST 2015
Change-Id: I3b806abdaf9540b7c39c961c179c2d2b15d327fe
---
python/samba/tests/__init__.py | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/python/samba/tests/__init__.py b/python/samba/tests/__init__.py
index d85260c..86ec3df 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."""
--
2.1.4
More information about the samba-technical
mailing list