Ejemplo n.º 1
0
def test_netmiko_args(first_router_from_devices_yaml):
    ssh = task_24_2c.MyNetmiko(**first_router_from_devices_yaml)
    command = "sh version"
    output_with_command = ssh.send_command(command, strip_command=False)
    assert command in output_with_command
    output_without_command = ssh.send_command(command, strip_command=True)
    ssh.disconnect()
    assert command not in output_without_command
Ejemplo n.º 2
0
def test_class_inheritance(first_router_from_devices_yaml):
    ssh = task_24_2c.MyNetmiko(**first_router_from_devices_yaml)
    ssh.disconnect()
    assert isinstance(
        ssh, CiscoIosSSH), "Класс MyNetmiko должен наследовать CiscoIosSSH"
    check_attr_or_method(ssh, method="send_command")
Ejemplo n.º 3
0
def test_class_inheritance(first_router_from_devices_yaml):
    r1 = task_24_2c.MyNetmiko(**first_router_from_devices_yaml)
    r1.disconnect()
    assert isinstance(
        r1, CiscoIosSSH), "MyNetmiko class must inherit from CiscoIosSSH"
    check_attr_or_method(r1, method="send_command")