From: John Mulligan Date: Fri, 1 Nov 2024 18:37:14 +0000 (-0400) Subject: cephadm: fix invalid use of mock called_with method X-Git-Tag: v20.0.0~647^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9fbbdf7c5306f362b43b670e78b96c1821f6a7d5;p=ceph.git cephadm: fix invalid use of mock called_with method Fixes `AttributeError: 'called_with' is not a valid assertion` errors that appear when running the unit tests with python3.12. Part of an effort to get ceph tox environments passing on Python 3.12. Signed-off-by: John Mulligan --- diff --git a/src/cephadm/tests/test_agent.py b/src/cephadm/tests/test_agent.py index 52cce74e1fb8..8e453e3ac3c0 100644 --- a/src/cephadm/tests/test_agent.py +++ b/src/cephadm/tests/test_agent.py @@ -668,7 +668,7 @@ def test_mgr_listener_run(_load_cert_chain, _load_verify_locations, _handle_json agent.mgr_listener.run() # verify payload was correctly extracted - assert _handle_json_payload.called_with(json.loads(payload)) + _handle_json_payload.assert_called_with(json.loads(payload)) FakeConn.send.assert_called_once_with(b'ACK') # second run, with bad json data received