Exemplo n.º 1
0
 def test_pack_generic_hello(self):
     """Test packing a generic hello message."""
     data = b'\x04\x00\x00\x10\x00\x00\x00\x3e'
     data += b'\x00\x01\x00\x08\x00\x00\x00\x10'
     generic_hello = GenericHello(packet=data, versions=b'\x04')
     self.assertEqual(generic_hello.pack(), data)
Exemplo n.º 2
0
 def test_pack(self, mock_ofptype):
     """Test pack."""
     mock_ofptype.return_value = True
     generic = GenericHello(packet=self.data, versions=b'\x04')
     response = generic.pack()
     self.assertEqual(self.data, response)