Drop use of invalid assert_called_once call

assert_called_once is not a valid mock assertion; switch
to assessing the call_count == 1 instead.

Change-Id: I906fd9784cb7207bb1a52ac8a63108565c2c3e9f
This commit is contained in:
James Page 2016-05-23 10:40:09 +01:00
parent 2d7d81df5d
commit 44c397cbd3

View File

@ -284,7 +284,7 @@ class ResourceTest(test.TestCase):
self.assertEqual('done', response)
# The following check verifies that mask_password was called with
# the decoded body.
masker.assert_called_once()
self.assertEqual(1, masker.call_count)
decoded_body = encodeutils.safe_decode(
serialized_body, errors='ignore')
self.assertIn(decoded_body, masker.call_args[0][0])