diff options
author | Michael Foord <michael@voidspace.org.uk> | 2011-07-18 12:59:49 +0100 |
---|---|---|
committer | Michael Foord <michael@voidspace.org.uk> | 2011-07-18 12:59:49 +0100 |
commit | b4ff14dd15b59a20aff9d9440de70ef6050823b3 (patch) | |
tree | d672ac715bc9524e0a7f5f13756da68b7d4e3d06 /tests/testhelpers.py | |
parent | 3f33d2146dbf500daee1c603f246ff40e57d50a7 (diff) | |
download | mock-b4ff14dd15b59a20aff9d9440de70ef6050823b3.tar.gz |
Addition of 'call_list' method to call for chained call assertions
Diffstat (limited to 'tests/testhelpers.py')
-rw-r--r-- | tests/testhelpers.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/testhelpers.py b/tests/testhelpers.py index e475dd8..0b9dbcb 100644 --- a/tests/testhelpers.py +++ b/tests/testhelpers.py @@ -164,7 +164,10 @@ class CallTest(unittest2.TestCase): mock = MagicMock() mock.foo(1).bar()().baz.beep(a=6) - self.assertEqual(mock.mock_calls[-1], call.foo().bar()().baz.beep(a=6)) + last_call = call.foo(1).bar()().baz.beep(a=6) + self.assertEqual(mock.mock_calls[-1], last_call) + self.assertEqual(mock.mock_calls, last_call.call_list()) + |