UT: Simplify test logic in test_control_find_server__control_message_sent_to_necessary_relays

This commit is contained in:
Shreya Malviya 2022-09-07 18:07:22 +05:30 committed by Mike Salvatore
parent 47f838cf9f
commit 0239a1be6b
1 changed files with 2 additions and 4 deletions

View File

@ -61,14 +61,12 @@ def test_control_find_server__control_message_sent_to_necessary_relays(monkeypat
cc = ControlClient(servers)
return_value = cc.find_server(servers)
assert cc.find_server(servers) is True
assert len(servers) == 2
assert return_value is True
assert mock_connect.call_count == 2
server_3_ip, server_3_port = address_to_ip_port(SERVER_3)
server_4_ip, server_4_port = address_to_ip_port(SERVER_4)
assert mock_connect.call_count == 2
mock_connect.assert_has_calls(
[mock.call((server_3_ip, int(server_3_port))), mock.call((server_4_ip, int(server_4_port)))]
)