コード例 #1
0
 def test_pingd(self):
     data = 'hello world'
     command = PingD(data=data)
     response = self._send_command(command.pack())
     self.assertEqual(PongD(data=data).pack(), response)
コード例 #2
0
ファイル: test_protocol.py プロジェクト: lyapun/advanced-01
 def test_init(self):
     pingd = PingD(data='hello world')
     self.assertEqual(PINGD, pingd.command)
     self.assertEqual('hello world', pingd.data)
コード例 #3
0
ファイル: test_protocol.py プロジェクト: lyapun/advanced-01
 def test_pack(self):
     pingd = PingD(data='hello world')
     self.assertEqual(b'\x00\x00\x00\x0C2hello world', pingd.pack())
コード例 #4
0
ファイル: test_server01.py プロジェクト: lyapun/advanced-01
 def test_pingd(self):
     data = 'hello world'
     command = PingD(data=data)
     response = self._send_command(command.pack())
     self.assertEqual(PongD(data=data).pack(), response)