From 928aa3ef114ebf9246c90f9eae80da9a20172530 Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Sun, 15 May 2016 13:05:33 +0200 Subject: Add ip link support to mac local_macs, improove test result readability --- tests/test_discovery.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tests/test_discovery.py') 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() -- cgit v1.1