Example #1
0
 def test_unpack(self):
     packet = Packet.unpack(b'3')
     self.assertEqual(Quit, type(packet))
     self.assertEqual(QUIT, packet.command)
Example #2
0
 def test_unpack(self):
     packet = Packet.unpack(b'2hello world')
     self.assertEqual(PingD, type(packet))
     self.assertEqual(PINGD, packet.command)
     self.assertEqual('hello world', packet.data)
Example #3
0
 def test_unpack(self):
     packet = Packet.unpack(b'1')
     self.assertEqual(Ping, type(packet))
     self.assertEqual(PING, packet.command)
Example #4
0
 def test_unpack(self):
     packet = Packet.unpack(b'0')
     self.assertEqual(Connect, type(packet))
     self.assertEqual(CONNECT, packet.command)
Example #5
0
 def test_unpack(self):
     packet = Packet.unpack(b'5')
     self.assertEqual(Finish, type(packet))
     self.assertEqual(FINISH, packet.command)
Example #6
0
 def test_unpack(self):
     packet = Packet.unpack(b'4hello world')
     self.assertEqual(QuitD, type(packet))
     self.assertEqual(QUITD, packet.command)
     self.assertEqual('hello world', packet.data)