def test_response_parse_genie_fail(): response = Response("localhost", channel_input="show ip arp", genie_platform="iosxe") response_bytes = b"" response._record_response(response_bytes) assert response.genie_parse_output() == []
def test_response_parse_genie(): response = Response("localhost", channel_input="show ip arp", genie_platform="iosxe") response_str = """Protocol Address Age (min) Hardware Addr Type Interface Internet 172.31.254.1 - 0000.0c07.acfe ARPA Vlan254 Internet 172.31.254.2 - c800.84b2.e9c2 ARPA Vlan254 """ response._record_response(response_str) result = response.genie_parse_output() assert ( result["interfaces"]["Vlan254"]["ipv4"]["neighbors"]["172.31.254.1"]["ip"] == "172.31.254.1" )