def test_unpack_packed(self):
     """Testing unpack of packed HWAddress."""
     mac = '0a:d3:98:a5:30:47'
     hw_addr = basic_types.HWAddress(mac)
     packed = hw_addr.pack()
     unpacked = basic_types.HWAddress()
     unpacked.unpack(packed)
     self.assertEqual(mac, unpacked.value)
 def test_default_value(self):
     """Testing default_value for HWAddress."""
     mac = '00:00:00:00:00:00'
     hw_addr = basic_types.HWAddress()
     packed = hw_addr.pack()
     unpacked = basic_types.HWAddress()
     unpacked.unpack(packed)
     self.assertEqual(mac, unpacked.value)
Esempio n. 3
0
 def test_pack_packable_value(self):
     """Test packing packable value."""
     hw_addr = basic_types.HWAddress('0a:d3:98:a5:30:47')
     expected = hw_addr.pack()
     actual = BinaryData(hw_addr).pack()
     self.assertEqual(expected, actual)