From 8fd775ee3a76e7f246c120fb68aa487c79c73d80 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 25 Nov 2024 17:44:51 +0000 Subject: [PATCH] Use .args for clarity --- tests/federation/test_federation_sender.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/federation/test_federation_sender.py b/tests/federation/test_federation_sender.py index cdf6100e78a..cd906bbbc78 100644 --- a/tests/federation/test_federation_sender.py +++ b/tests/federation/test_federation_sender.py @@ -247,7 +247,7 @@ def test_send_receipts_with_backoff_recent_event(self) -> None: # expect a call to send_transaction for each host self.assertEqual(mock_send_transaction.call_count, 20) - self._assert_edu_in_call(mock_send_transaction.call_args[0][1]) + self._assert_edu_in_call(mock_send_transaction.call_args.args[1]) mock_send_transaction.reset_mock() @@ -285,14 +285,14 @@ def test_send_receipts_with_backoff_sender(self) -> None: # First, expect a call to send_transaction for the sending host mock_send_transaction.assert_called() - transaction = mock_send_transaction.call_args_list[0][0][0] + transaction = mock_send_transaction.call_args_list[0].args[0] self.assertEqual(transaction.destination, "host1") - self._assert_edu_in_call(mock_send_transaction.call_args_list[0][0][1]) + self._assert_edu_in_call(mock_send_transaction.call_args_list[0].args[1]) # We also expect a call to one of the other hosts, as the first # destination to wake up. self.assertEqual(mock_send_transaction.call_count, 2) - self._assert_edu_in_call(mock_send_transaction.call_args[0][1]) + self._assert_edu_in_call(mock_send_transaction.call_args.args[1]) mock_send_transaction.reset_mock() @@ -305,7 +305,7 @@ def test_send_receipts_with_backoff_sender(self) -> None: ) mock_send_transaction.assert_called_once() - self._assert_edu_in_call(mock_send_transaction.call_args[0][1]) + self._assert_edu_in_call(mock_send_transaction.call_args.args[1]) mock_send_transaction.reset_mock() def _assert_edu_in_call(self, json_cb: Callable[[], JsonDict]) -> None: