Agent: Rename on_user_connected to add_relay_user

This commit is contained in:
Ilija Lazoroski 2022-09-01 13:41:50 +02:00
parent 43a1ddb714
commit 508b811939
3 changed files with 4 additions and 3 deletions

View File

@ -60,7 +60,7 @@ class TCPRelay(Thread):
def stop(self):
self._stopped.set()
def on_user_connected(self, user_address: IPv4Address):
def add_relay_user(self, user_address: IPv4Address):
"""
Handle new user connection.

View File

@ -35,7 +35,7 @@ def join_or_kill_thread(thread: Thread, timeout: float):
def test_user_added(tcp_relay):
tcp_relay.on_user_connected(NEW_USER_ADDRESS)
tcp_relay.add_relay_user(NEW_USER_ADDRESS)
users = tcp_relay.relay_users()
assert len(users) == 1
@ -43,7 +43,7 @@ def test_user_added(tcp_relay):
def test_user_removed_on_request(tcp_relay):
tcp_relay.on_user_connected(NEW_USER_ADDRESS)
tcp_relay.add_relay_user(NEW_USER_ADDRESS)
tcp_relay.on_user_data_received(RELAY_CONTROL_MESSAGE, NEW_USER_ADDRESS)
users = tcp_relay.relay_users()

View File

@ -289,6 +289,7 @@ serialized_event
# TODO: Remove after #2231 is closed
relay_users
last_update_time
add_relay_user
# pydantic base models
underscore_attrs_are_private