def test_path_for_employee1_should_end_with_foo_gw(self): path = l2trace.get_path('10.0.20.10') self.assertEqual(path[-1].host, self.foo_gw)
def test_path_for_employee1_should_be_on_vlan_20(self): path = l2trace.get_path('10.0.20.10') self.assertEqual(path[0].vlan.vlan, 20) self.assertEqual(path[1].vlan.vlan, 20)
def test_path_for_employee1_should_start_with_employee_1(self): path = l2trace.get_path('10.0.20.10') self.assertTrue(isinstance(path[0].host, l2trace.Host))
def test_path_for_employee2_should_be_3_long(self): path = l2trace.get_path('10.0.20.90') self.assertEqual(len(path), 3, path)
def test_path_for_foo_sw1_should_be_on_vlan_10(self): path = l2trace.get_path(self.foo_sw1.ip) self.assertEqual(path[0].vlan.vlan, 10) self.assertEqual(path[1].vlan.vlan, 10)
def test_path_for_foo_sw1_should_end_at_foo_gw(self): path = l2trace.get_path(self.foo_sw1.ip) self.assertEqual(path[-1].host, self.foo_gw)
def test_path_for_foo_sw1_should_start_with_foo_sw1(self): path = l2trace.get_path(self.foo_sw1.ip) self.assertEqual(path[0].host, self.foo_sw1)
def test_path_for_foo_sw1_should_be_2_long(self): path = l2trace.get_path(self.foo_sw1.ip) self.assertEqual(len(path), 2)