def test02_pingWithNoneTimer(self): def myDataWrite(clientSelf): failIf(True) log_history.reset() client = pokernetwork.client.UGAMEClientProtocol() client.dataWrite = myDataWrite client._ping_timer = None client.factory = None self.assertEquals(client.ping(), None) self.assertEqual(log_history.get_all(), [])
def test02_pingWithNoneTimer(self): def myDataWrite(clientSelf): failIf(True) clear_all_messages() client = pokernetwork.client.UGAMEClientProtocol() client.dataWrite = myDataWrite client._ping_timer = None client.factory = None self.assertEquals(client.ping(), None) self.assertEqual(get_messages(), [])
def test03_pingWithActiveTimer(self): def myDataWrite(clientSelf): failIf(True) log_history.reset() client = pokernetwork.client.UGAMEClientProtocol() pt = MockPingTimer() pt.isActive = True client._ping_timer = pt client.factory = None self.assertEquals(client.ping(), None) self.assertEquals(pt, client._ping_timer) self.assertEquals(pt.resetValues, [ 5 ]) self.assertEquals(pt.cancelCount, 0) self.assertEqual(log_history.get_all(), [])