Skip to content

Commit 79e1ef9

Browse files
committed
Updated TestContact class to address test issues
1 parent d196b28 commit 79e1ef9

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

tests/contacts/test_contact_tcp.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,6 @@ def test_refresh_without_socket_errors(self, event_loop):
4141
class TestContact:
4242

4343
def test_tcp_contact(self, event_loop):
44-
tcp_c2 = Contact(services=None)
45-
tcp_c2.set_up_server = mock.Mock()
46-
# ensure start() has a valid address string to split
47-
# prefer the real attribute name used by Contact (address/server_address/host). If unknown,
48-
# set both common names:
49-
if not getattr(tcp_c2, "server_address", None):
50-
tcp_c2.server_address = "127.0.0.1:0"
51-
if not getattr(tcp_c2, "address", None):
52-
tcp_c2.address = "127.0.0.1:0"
44+
tcp_c2 = Contact(services=mock.Mock()))
5345
event_loop.run_until_complete(tcp_c2.start())
54-
assert tcp_c2 is not None
55-
assert tcp_c2.tcp_handler is not None
46+
assert tcp_c2 is not None

0 commit comments

Comments
 (0)