diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2015-02-05 22:04:44 +0100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2015-03-06 07:11:43 +0100 |
commit | 7004ccc441f700692b95dba89f8d3c4f30f2ca18 (patch) | |
tree | b98053272c0d84c3010c6643bc8cf7df557607ca | |
parent | a6b2110abd061b0e03d8b684e5a2edd12fbc1c64 (diff) | |
download | samba-7004ccc441f700692b95dba89f8d3c4f30f2ca18.tar.gz samba-7004ccc441f700692b95dba89f8d3c4f30f2ca18.tar.xz samba-7004ccc441f700692b95dba89f8d3c4f30f2ca18.zip |
Implement TestCase.assertIsNotNone for python < 2.7.
Change-Id: Ieaefdc77495e27bad791075d985a70908e9be1ad
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Mar 6 07:11:43 CET 2015 on sn-devel-104
-rw-r--r-- | python/samba/tests/__init__.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/python/samba/tests/__init__.py b/python/samba/tests/__init__.py index 840e5c3628..3e7094fe06 100644 --- a/python/samba/tests/__init__.py +++ b/python/samba/tests/__init__.py @@ -64,14 +64,17 @@ class TestCase(unittest.TestCase): def assertIn(self, member, container, msg=None): self.assertTrue(member in container, msg) - def assertIs(self, a, b): - self.assertTrue(a is b) + def assertIs(self, a, b, msg=None): + self.assertTrue(a is b, msg) - def assertIsNot(self, a, b): - self.assertTrue(a is not b) + def assertIsNot(self, a, b, msg=None): + self.assertTrue(a is not b, msg) - def assertIsInstance(self, a, b): - self.assertTrue(isinstance(a, b)) + def assertIsNotNone(self, a, msg=None): + self.assertTrue(a is not None) + + def assertIsInstance(self, a, b, msg=None): + self.assertTrue(isinstance(a, b), msg) def assertIsNone(self, a, msg=None): self.assertTrue(a is None, msg) |