summaryrefslogtreecommitdiff
path: root/lib/subunit/python/testtools/tests/test_testtools.py
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-01-16 19:56:21 +1300
committerJelmer Vernooij <jelmer@samba.org>2010-01-16 19:56:21 +1300
commit2ec5792a4ba0cefa079a6d7e1b0ec2472151e794 (patch)
tree6036a0b1a9da56619e970a8b0650328c50f0ad97 /lib/subunit/python/testtools/tests/test_testtools.py
parent28577aae928847e64a0274b5922e26e1f15d9916 (diff)
downloadsamba-2ec5792a4ba0cefa079a6d7e1b0ec2472151e794.tar.gz
samba-2ec5792a4ba0cefa079a6d7e1b0ec2472151e794.tar.bz2
samba-2ec5792a4ba0cefa079a6d7e1b0ec2472151e794.zip
subunit/testtools: Include newer version.
Diffstat (limited to 'lib/subunit/python/testtools/tests/test_testtools.py')
-rw-r--r--lib/subunit/python/testtools/tests/test_testtools.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/subunit/python/testtools/tests/test_testtools.py b/lib/subunit/python/testtools/tests/test_testtools.py
index 8cd90de6fe..af1fd794c3 100644
--- a/lib/subunit/python/testtools/tests/test_testtools.py
+++ b/lib/subunit/python/testtools/tests/test_testtools.py
@@ -223,6 +223,12 @@ class TestAssertions(TestCase):
self.assertFails('None is not 42', self.assertIs, None, 42)
self.assertFails('[42] is not [42]', self.assertIs, [42], [42])
+ def test_assertIs_fails_with_message(self):
+ # assertIs raises assertion errors if one object is not identical to
+ # another, and includes a user-supplied message, if it's provided.
+ self.assertFails(
+ 'None is not 42: foo bar', self.assertIs, None, 42, 'foo bar')
+
def test_assertIsNot(self):
# assertIsNot asserts that an object is not identical to another
# object.
@@ -238,6 +244,12 @@ class TestAssertions(TestCase):
self.assertFails(
'[42] is [42]', self.assertIsNot, some_list, some_list)
+ def test_assertIsNot_fails_with_message(self):
+ # assertIsNot raises assertion errors if one object is identical to
+ # another, and includes a user-supplied message if it's provided.
+ self.assertFails(
+ 'None is None: foo bar', self.assertIsNot, None, None, "foo bar")
+
def test_assertThat_matches_clean(self):
class Matcher:
def match(self, foo):
@@ -303,12 +315,12 @@ class TestAddCleanup(TestCase):
self.assertEqual(messages, [call[0] for call in self._result_calls])
def assertTestLogEqual(self, messages):
- """Assert that the call log equals `messages`."""
+ """Assert that the call log equals 'messages'."""
case = self._result_calls[0][1]
self.assertEqual(messages, case._calls)
def logAppender(self, message):
- """A cleanup that appends `message` to the tests log.
+ """A cleanup that appends 'message' to the tests log.
Cleanups are callables that are added to a test by addCleanup. To
verify that our cleanups run in the right order, we add strings to a