diff options
Diffstat (limited to 'tests/test_discovery.py')
-rwxr-xr-x | tests/test_discovery.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/test_discovery.py b/tests/test_discovery.py index b0de19b..7fb0bd2 100755 --- a/tests/test_discovery.py +++ b/tests/test_discovery.py @@ -3,9 +3,9 @@ import unittest #import pudb; pudb.set_trace() from context import haircontrol -from haircontrol import discovery, data +from haircontrol import discovery, data, inspectors -class MockInspector(object): +class MockInspector(inspectors.Inspector): def __init__(self, testDataPath): self.testDataPath = testDataPath self.e = None @@ -20,7 +20,7 @@ class MockInspector(object): if not self.e: return None mockfile = self.testDataPath + '/' + self.e.name + '-' + command + '.out' - return open(mockfile) + return open(mockfile) #XXX use Inspector.parse() class TestDiscovery(unittest.TestCase): @@ -30,11 +30,11 @@ class TestDiscovery(unittest.TestCase): self.maxDiff=None def test_wire_graph(self): - ref_equipments = { 'todo': data.Equipment() } #json.load('../test-data/ref-output/equipments.json') + ref_net = data.EtherDomain() #json.load('../test-data/ref-output/equipments.json') - self.discovery.discover_hinting_from_lldp(data.Equipment('stg2', '172.16.0.254')) - self.discovery.discover_from_root(data.Equipment('stg', '172.16.0.253')) - self.assertDictEqual(self.discovery.net.equipments, ref_equipments) + self.discovery.discover_hinting_from_lldp(data.Equipment('stg2', '172.16.0.253')) + self.discovery.discover_from_root(data.Equipment('stg', '172.16.0.254')) + self.assertEqual(ref_net.get_equipment_list_sorted(), list(self.discovery.net.get_equipment_list_sorted())) if __name__ == '__main__': unittest.main() |