def testLinktestWhileDisconnecting(self): self.server.simulate_connect() system_id = self.server.get_next_system_counter() self.server.simulate_packet( secsgem.HsmsPacket(secsgem.HsmsLinktestReqHeader(system_id))) packet = self.server.expect_packet(system_id=system_id) self.assertIsNot(packet, None) self.assertEqual(packet.header.sType, 0x06) self.assertEqual(packet.header.sessionID, 0xffff)
def testLinktest(self): self.server.simulate_connect() # set the connection to disconnecting by brute force self.client.connection.disconnecting = True system_id = self.server.get_next_system_counter() self.server.simulate_packet( secsgem.HsmsPacket(secsgem.HsmsLinktestReqHeader(system_id))) packet = self.server.expect_packet(system_id=system_id) self.assertIsNot(packet, None) self.assertEqual(packet.header.sType, 0x07) self.assertEqual(packet.header.sessionID, 0xffff)