Ejemplo n.º 1
0
 def test_mac_default(self):
     mac = '1a:b2:c3:0a:ff:99'
     result = _parse_mac_addr(mac)
     expected = b'\x1a\xb2\xc3\x0a\xff\x99'
     self.assertEqual(expected, result)
Ejemplo n.º 2
0
 def test_mac_longer(self):
     mac = '1a:b2:c3:0a:ff:99:aa'
     result = _parse_mac_addr(mac)
     expected = None
     self.assertEqual(expected, result)
Ejemplo n.º 3
0
 def test_mac_wrong_bytes(self):
     mac = '1a:b2:g3:0a:if:99'
     result = _parse_mac_addr(mac)
     expected = None
     self.assertEqual(expected, result)
Ejemplo n.º 4
0
 def test_mac_shorter(self):
     mac = '1a:b2:c3:0a:ff'
     result = _parse_mac_addr(mac)
     expected = None
     self.assertEqual(expected, result)
Ejemplo n.º 5
0
 def test_mac_extra_symbols(self):
     mac = 'My mac is 1a:b2:c3:0a:ff:99 check it please'
     result = _parse_mac_addr(mac)
     expected = b'\x1a\xb2\xc3\x0a\xff\x99'
     self.assertEqual(expected, result)
Ejemplo n.º 6
0
 def test_mac_upper_case(self):
     mac = '1A:B2:C3:0A:FF:99'
     result = _parse_mac_addr(mac)
     expected = b'\x1a\xb2\xc3\x0a\xff\x99'
     self.assertEqual(expected, result)
Ejemplo n.º 7
0
 def test_mac_dash_sep(self):
     mac = '1a-b2-c3-0a-ff-99'
     result = _parse_mac_addr(mac)
     expected = b'\x1a\xb2\xc3\x0a\xff\x99'
     self.assertEqual(expected, result)
Ejemplo n.º 8
0
 def test_mac_dot_sep(self):
     mac = '1a.b2.c3.0a.ff.99'
     result = _parse_mac_addr(mac)
     expected = b'\x1a\xb2\xc3\x0a\xff\x99'
     self.assertEqual(expected, result)