From e3a9feb6984136172616260293130095e19051e2 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 27 Jan 2015 03:40:34 +0100 Subject: Add custom implementations of TestCase.assertIs and TestCase.assertIsNot, for Python2.6. Change-Id: I3b806abdaf9540b7c39c961c179c2d2b15d327fe Signed-off-by: Jelmer Vernooij Reviewed-by: Andrew Bartlett --- python/samba/tests/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'python') 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.""" -- cgit