Changed assertCalledOnceWith() to assert_called_once_with()

When I change assertCalledOnceWith() to assert_called_once_with(), make test succeeds but shows another failure:
```
AssertionError: Expected call: mock(sentinel.size, sentinel.modified_time)
Actual call: mock(sentinel.since, sentinel.modified_time, sentinel.size)
```
After changing the call accordingly, all 59 tests succeed.
This commit is contained in:
René Leonhardt 2015-07-14 14:53:14 +02:00
parent 75b51ce214
commit 5e4ae2fdc9

View file

@ -75,7 +75,7 @@ class DownloadMixinTestCase(unittest.TestCase):
self.assertIs(
mixin.was_modified_since(file_wrapper, mock.sentinel.since),
mock.sentinel.was_modified)
file_wrapper.was_modified_since.assertCalledOnceWith(
file_wrapper.was_modified_since.assert_called_once_with(
mock.sentinel.since)
def test_was_modified_since_django(self):
@ -101,9 +101,10 @@ class DownloadMixinTestCase(unittest.TestCase):
self.assertIs(
mixin.was_modified_since(file_wrapper, mock.sentinel.since),
mock.sentinel.was_modified)
was_modified_since_mock.assertCalledOnceWith(
mock.sentinel.size,
mock.sentinel.modified_time)
was_modified_since_mock.assert_called_once_with(
mock.sentinel.since,
mock.sentinel.modified_time,
mock.sentinel.size)
def test_was_modified_since_fallback(self):
"""DownloadMixin.was_modified_since() fallbacks to `True`.