def testGetMACFromDataWithBadData(self):
   mac_data = (0, 62)
   buf = struct.pack('2B', *mac_data)
   with self.assertRaises(systemconfig.InterfaceError):
     systemconfig._GetMACFromData(buf)
Exemple #2
0
 def testGetMACFromDataWithBadData(self):
     mac_data = (0, 62)
     buf = struct.pack('2B', *mac_data)
     with self.assertRaises(systemconfig.InterfaceError):
         systemconfig._GetMACFromData(buf)
 def testGetMACFromData(self):
   """Test _GetMACFromData."""
   mac_data = (0, 62, 225, 190, 73, 13)
   mac_str = '00:3e:e1:be:49:0d'
   buf = struct.pack('6B', *mac_data)
   self.assertEqual(mac_str, systemconfig._GetMACFromData(buf))
Exemple #4
0
 def testGetMACFromData(self):
     """Test _GetMACFromData."""
     mac_data = (0, 62, 225, 190, 73, 13)
     mac_str = '00:3e:e1:be:49:0d'
     buf = struct.pack('6B', *mac_data)
     self.assertEqual(mac_str, systemconfig._GetMACFromData(buf))