Skip to content

Commit

Permalink
Nentengine issue#33: corrected indentation and spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
bucciarellialessandro committed Nov 12, 2014
1 parent ec2ef5d commit f8be554
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
1 change: 0 additions & 1 deletion netengine/resources/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import json



def parse_manufacturer():
dictionary = {}
manufacturer_file = open("manufacturers.txt")
Expand Down
1 change: 1 addition & 0 deletions netengine/utils/manufacturer_lookup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ def manufacturer_lookup(mac_address):
mac_address = str(mac_address.replace(':', '').replace('-', '').upper())
mac_address = mac_address[0:6]
return dictionary[mac_address]

20 changes: 11 additions & 9 deletions tests/utils/lookup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@
from netengine.resources.manufacturers import dictionary
from netengine.utils import manufacturer_lookup


class TestDictLookup(unittest.TestCase):
def test_multiple_mac(self):
all_capitalized_mac = "3C0E23DB1D1E"
all_lowered_mac = "3C0E23db1d1e"
mixed_dashed_mac = "3C-0E-23-DB-1D-1E"
mixed_mac = "3c:0e-23:Db-1D-1e"
def test_multiple_mac(self):
all_capitalized_mac = "3C0E23DB1D1E"
all_lowered_mac = "3C0E23db1d1e"
mixed_dashed_mac = "3C-0E-23-DB-1D-1E"
mixed_mac = "3c:0e-23:Db-1D-1e"

self.assertEqual(dictionary[all_capitalized_mac], "Cisco")
self.assertEqual(dictionary[all_lowered_mac], "Cisco")
self.assertEqual(dictionary[mixed_dashed_mac], "Cisco")
self.assertEqual(dictionary[mixed_mac], "Cisco")

self.assertEqual(dictionary[all_capitalized_mac], "Cisco")
self.assertEqual(dictionary[all_lowered_mac], "Cisco")
self.assertEqual(dictionary[mixed_dashed_mac], "Cisco")
self.assertEqual(dictionary[mixed_mac], "Cisco")

0 comments on commit f8be554

Please sign in to comment.