def test_adminstate_down(self): intf = Interface('eth', '1', '1', '1', '1') intf.adminstatus = 'down' phys_domain_json, fabric_json, infra_json = intf.get_json() expected_json = ("{'fabricOOServicePol': {'children': [{'fabricRsOosPa" "th': {'attributes': {'tDn': 'topology/pod-1/paths-1/" "pathep-[eth1/1]', 'lc': 'blacklist'}, 'children': []" "}}]}}") self.assertEqual(str(fabric_json), expected_json)
def test_adminstate_up(self): intf = Interface('eth', '1', '1', '1', '1') intf.adminstatus = 'up' phys_domain_json, fabric_json, infra_json = intf.get_json() expected_json = ("{'fabricOOServicePol': {'children': [{'fabricRsOosPa" "th': {'attributes': {'dn': 'uni/fabric/outofsvc/rsoo" "sPath-[topology/pod-1/paths-1/pathep-[eth1/1]]', 'st" "atus': 'deleted', 'tDn': 'topology/pod-1/paths-1/pat" "hep-[eth1/1]'}, 'children': []}}]}}") self.assertEqual(str(fabric_json), expected_json)