Ejemplo n.º 1
0
 def test_remove_connection_w_presence(self, test_uuids):
     server_state = get_state()
     user = User("test_user")
     server_state.users[user.username] = user
     connection = Connection("test_user", conn_id=test_uuids[1])
     user.add_connection(connection)
     config = {"notify_presence": True, "broadcast_presence_with_user_lists": True}
     channel = Channel("test", channel_config=config)
     channel.add_connection(connection)
     channel.remove_connection(connection)
Ejemplo n.º 2
0
 def test_remove_connection_w_presence(self, test_uuids):
     server_state = get_state()
     user = User("test_user")
     server_state.users[user.username] = user
     connection = Connection("test_user", conn_id=test_uuids[1])
     user.add_connection(connection)
     config = {
         "notify_presence": True,
         "broadcast_presence_with_user_lists": True
     }
     channel = Channel("test", channel_config=config)
     channel.add_connection(connection)
     channel.remove_connection(connection)
Ejemplo n.º 3
0
 def test_remove_connection(self, test_uuids):
     connection = Connection("test_user", conn_id=test_uuids[1])
     connection2 = Connection("test_user2", conn_id=test_uuids[2])
     connection3 = Connection("test_user", conn_id=test_uuids[3])
     channel = Channel("test")
     channel.add_connection(connection)
     channel.add_connection(connection2)
     channel.remove_connection(connection)
     assert "test_user" not in channel.connections
     assert len(channel.connections["test_user2"]) == 1
     channel.add_connection(connection)
     channel.add_connection(connection3)
     channel.remove_connection(connection)
     assert len(channel.connections["test_user"]) == 1
Ejemplo n.º 4
0
 def test_remove_connection(self, test_uuids):
     connection = Connection("test_user", conn_id=test_uuids[1])
     connection2 = Connection("test_user2", conn_id=test_uuids[2])
     connection3 = Connection("test_user", conn_id=test_uuids[3])
     channel = Channel("test")
     channel.add_connection(connection)
     channel.add_connection(connection2)
     channel.remove_connection(connection)
     assert "test_user" not in channel.connections
     assert len(channel.connections["test_user2"]) == 1
     channel.add_connection(connection)
     channel.add_connection(connection3)
     channel.remove_connection(connection)
     assert len(channel.connections["test_user"]) == 1
Ejemplo n.º 5
0
 def test_remove_non_existant_connection(self, test_uuids):
     channel = Channel("test")
     connection = Connection("test_user", conn_id=test_uuids[1])
     channel.remove_connection(connection)
     assert "test_user" not in channel.connections
Ejemplo n.º 6
0
 def test_remove_non_existant_connection(self, test_uuids):
     channel = Channel("test")
     connection = Connection("test_user", conn_id=test_uuids[1])
     channel.remove_connection(connection)
     assert "test_user" not in channel.connections