]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: fix invalid use of mock called_with method
authorJohn Mulligan <jmulligan@redhat.com>
Fri, 1 Nov 2024 18:37:14 +0000 (14:37 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Mon, 4 Nov 2024 20:38:43 +0000 (15:38 -0500)
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 <jmulligan@redhat.com>
src/cephadm/tests/test_agent.py

index 52cce74e1fb8f32c63411f0b4d2b799885cab096..8e453e3ac3c062064dbaaf2c5d052737672ba196 100644 (file)
@@ -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