def test_set_pgpool_connected(self):
     playertracker1 = PlayerTracker()
     self.assertFalse(playertracker1.is_pgpool_connected(123))
     self.assertFalse(playertracker1.is_pgpool_disconnected(123))
     playertracker1.set_pgpool_disconnected(123)
     self.assertFalse(playertracker1.is_pgpool_connected(123))
     self.assertTrue(playertracker1.is_pgpool_disconnected(123))
 def test_ACK_COMMAND_CONNECT_PGPOOL(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)
     time.sleep(2)
     player_tracker = PlayerTracker()
     self.assertFalse(player_tracker.is_pgpool_connected(112))
     self.assertFalse(player_tracker.is_pgpool_connected(115))
     reply_to_conductor.acknowledgement_pgpool_disconnected(112, self.__connection, conductor.exchange, Constants.CONDUCTOR_ROUTING_KEY)
     time.sleep(2)
     self.assertTrue(player_tracker.is_pgpool_disconnected(112))
     self.assertFalse(player_tracker.is_pgpool_connected(115))
     reply_to_conductor.acknowledgement_pgpool_connected(112, self.__connection, conductor.exchange, Constants.CONDUCTOR_ROUTING_KEY)
     time.sleep(2)
     self.assertTrue(player_tracker.is_pgpool_connected(112))
     self.assertFalse(player_tracker.is_pgpool_connected(115))
 def test_ACK_COMMAND_CONNECT_PGPOOL(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)
     time.sleep(2)
     player_tracker = PlayerTracker()
     self.assertFalse(player_tracker.is_pgpool_connected(112))
     self.assertFalse(player_tracker.is_pgpool_connected(115))
     reply_to_conductor.acknowledgement_pgpool_disconnected(
         112, self.__connection, conductor.exchange,
         Constants.CONDUCTOR_ROUTING_KEY)
     time.sleep(2)
     self.assertTrue(player_tracker.is_pgpool_disconnected(112))
     self.assertFalse(player_tracker.is_pgpool_connected(115))
     reply_to_conductor.acknowledgement_pgpool_connected(
         112, self.__connection, conductor.exchange,
         Constants.CONDUCTOR_ROUTING_KEY)
     time.sleep(2)
     self.assertTrue(player_tracker.is_pgpool_connected(112))
     self.assertFalse(player_tracker.is_pgpool_connected(115))