def test_set_master_connected(self):
     playertracker1 = PlayerTracker()
     self.assertFalse(playertracker1.is_replication_started(123))
     self.assertFalse(playertracker1.is_replication_stopped(123))
     playertracker1.set_replication_stopped(123)
     self.assertFalse(playertracker1.is_replication_started(123))
     self.assertTrue(playertracker1.is_replication_stopped(123))
예제 #2
0
 def test_ACK_COMMAND_DISCONNECT_MASTER(self):
     reply_to_conductor.register_player(112, self.__connection, conductor.exchange, Constants.CONDUCTOR_ROUTING_KEY)
     reply_to_conductor.register_player(115, self.__connection, conductor.exchange, Constants.CONDUCTOR_ROUTING_KEY)
     reply_to_conductor.acknowledgement_master_disconnected(112, self.__connection, conductor.exchange, Constants.CONDUCTOR_ROUTING_KEY)
     time.sleep(2)
     player_tracker = PlayerTracker()
     self.assertTrue(player_tracker.is_replication_stopped(112))
     self.assertFalse(player_tracker.is_replication_stopped(115))
 def test_ACK_COMMAND_DISCONNECT_MASTER(self):
     reply_to_conductor.register_player(112, self.__connection,
                                        conductor.exchange,
                                        Constants.CONDUCTOR_ROUTING_KEY)
     reply_to_conductor.register_player(115, self.__connection,
                                        conductor.exchange,
                                        Constants.CONDUCTOR_ROUTING_KEY)
     reply_to_conductor.acknowledgement_master_disconnected(
         112, self.__connection, conductor.exchange,
         Constants.CONDUCTOR_ROUTING_KEY)
     time.sleep(2)
     player_tracker = PlayerTracker()
     self.assertTrue(player_tracker.is_replication_stopped(112))
     self.assertFalse(player_tracker.is_replication_stopped(115))