From 9a329dc1c681b155ddccb13e4758962070e40353 Mon Sep 17 00:00:00 2001 From: Daniel Sotirhos Date: Wed, 18 Sep 2024 10:13:25 -0700 Subject: [PATCH] Fix broken assert of Mock object's `not_called` property Resolves error during test: AttributeError: 'not_called' is not a valid assertion. Use a spec for the mock if 'not_called' is meant to be an attribute. --- test/service/test_manifest_async.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/service/test_manifest_async.py b/test/service/test_manifest_async.py index e328310a62..8a4a7346ed 100644 --- a/test/service/test_manifest_async.py +++ b/test/service/test_manifest_async.py @@ -336,9 +336,9 @@ def test(self, self.assertNotEqual(token_url, response.json()['Location']) assert signed_manifest_key.encode() == manifest_url.path.segments[-1] - assert verify_manifest_key.not_called + assert not verify_manifest_key.called verify_manifest_key.return_value = manifest_key - assert get_cached_manifest_with_key.not_called + assert not get_cached_manifest_with_key.called get_cached_manifest_with_key.return_value = manifest response = requests.get(str(manifest_url), allow_redirects=False) self.assertEqual(302, response.status_code)