mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
adjusted tests
This commit is contained in:
parent
9da3fb80f0
commit
aaa2084bfd
3 changed files with 6 additions and 4 deletions
|
@ -241,6 +241,7 @@ class P2PConnection:
|
|||
def received_data(self, frame):
|
||||
print(frame)
|
||||
self.p2p_data_rx_queue.put(frame['data'])
|
||||
|
||||
ack_data = self.frame_factory.build_p2p_connection_payload_ack(self.session_id, 0)
|
||||
self.launch_twr_irs(ack_data, self.ENTIRE_CONNECTION_TIMEOUT, mode=FREEDV_MODE.signalling)
|
||||
|
||||
|
|
|
@ -219,6 +219,7 @@ class StateManager:
|
|||
|
||||
def register_p2p_connection_session(self, session):
|
||||
if session.session_id in self.p2p_connection_sessions:
|
||||
print("session already registered...")
|
||||
return False
|
||||
self.p2p_connection_sessions[session.session_id] = session
|
||||
return True
|
||||
|
|
|
@ -160,15 +160,12 @@ class TestP2PConnectionSession(unittest.TestCase):
|
|||
|
||||
for session_id in self.iss_state_manager.p2p_connection_sessions:
|
||||
session = self.iss_state_manager.get_p2p_connection_session(session_id)
|
||||
|
||||
session.ENTIRE_CONNECTION_TIMEOUT = 15
|
||||
# Generate and add 5 random entries to the queue
|
||||
for _ in range(5):
|
||||
random_entry = self.generate_random_string(2, 11)
|
||||
session.p2p_data_tx_queue.put(random_entry)
|
||||
|
||||
|
||||
|
||||
|
||||
self.waitAndCloseChannels()
|
||||
|
||||
|
||||
|
@ -185,6 +182,9 @@ class TestSocket:
|
|||
if b'CONNECTED AA1AAA-1 BB2BBB-2 0\r\n' in self.sent_data:
|
||||
self.test_class.connected_event.set()
|
||||
|
||||
if b'DISCONNECTED\r\n' in self.sent_data:
|
||||
self.test_class.assertEqual(b'DISCONNECTED\r\n', b'DISCONNECTED\r\n')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
Loading…
Reference in a new issue