コード例 #1
0
def test_ping_no_ip():
    tool = WinOSClient(host='')
    response = tool.ping()

    if os.name == 'nt':
        assert response.stdout == 'IP address must be specified.', \
            'IP address must be specified.'
    else:
        assert 'Usage: ping' in response.stderr
コード例 #2
0
def test_ping_remote_host_with_no_ip_in_method():
    tool = WinOSClient(host='8.8.8.8')
    response = tool.ping()
    print(response)
    assert not response.exited, 'Exit code is not 0'
コード例 #3
0
def test_ping_packets_number(number):
    tool = WinOSClient(host='8.8.8.8')
    response = tool.ping(packets_number=number)
    assert number == response.stdout.count('from 8.8.8.8')
コード例 #4
0
def test_ping_remote_host_with_no_ip_in_class():
    tool = WinOSClient()
    response = tool.ping(host='8.8.8.8')
    assert not response.exited, 'Exit code is not 0'