Agent: Remove on_user_disconnected in TCPRelay

This commit is contained in:
Ilija Lazoroski 2022-09-01 13:32:07 +02:00
parent 6e0dc0ca13
commit a754963222
2 changed files with 0 additions and 13 deletions

View File

@ -72,10 +72,6 @@ class TCPRelay(Thread):
self._relay_users[user_address] = RelayUser(user_address, time())
def on_user_disconnected(self, user_address: IPv4Address):
"""Handle user disconnection."""
pass
def relay_users(self) -> Dict[IPv4Address, RelayUser]:
"""
Get the list of users connected to the relay.

View File

@ -42,15 +42,6 @@ def test_user_added(tcp_relay):
assert NEW_USER_ADDRESS in users
def test_user_not_removed_on_disconnect(tcp_relay):
# A user should only be disconnected when they send a disconnect request
tcp_relay.on_user_connected(NEW_USER_ADDRESS)
tcp_relay.on_user_disconnected(NEW_USER_ADDRESS)
users = tcp_relay.relay_users()
assert len(users) == 1
def test_user_removed_on_request(tcp_relay):
tcp_relay.on_user_connected(NEW_USER_ADDRESS)
tcp_relay.on_user_data_received(RELAY_CONTROL_MESSAGE, NEW_USER_ADDRESS)