Пример #1
0
def test_distance_same_ips():
    ret = ip_distance(url1=IP4_1, url2=IP4_1)
    assert ret["distance"] == 0
Пример #2
0
def test_distance_unavailable_ip():
    with pytest.raises(gaierror):
        assert ip_distance(url1=IP4_NA, url2=IP4_1)
Пример #3
0
def test_distance_valid_ips():
    ret = ip_distance(url1=IP4_1, url2=IP4_2)
    assert ret["distance"] is not None