def test_distance_same_ips(): ret = ip_distance(url1=IP4_1, url2=IP4_1) assert ret["distance"] == 0
def test_distance_unavailable_ip(): with pytest.raises(gaierror): assert ip_distance(url1=IP4_NA, url2=IP4_1)
def test_distance_valid_ips(): ret = ip_distance(url1=IP4_1, url2=IP4_2) assert ret["distance"] is not None