Skip to content

Commit

Permalink
Use .args for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston committed Nov 25, 2024
1 parent 801983c commit 8fd775e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/federation/test_federation_sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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()

Expand All @@ -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:
Expand Down

0 comments on commit 8fd775e

Please sign in to comment.