Migrate python tool chain to uv and ruff

This commit is contained in:
2025-12-29 13:31:13 +01:00
parent df1d08312f
commit f8f5187358
12 changed files with 823 additions and 133 deletions

View File

@@ -90,9 +90,9 @@ def test_lookup(test_dig):
assert str(test_dig._lookup_data("52.94.76.1")[0]["ip_prefix"]) == "52.94.76.0/22"
assert str(test_dig._lookup_data("52.94.76.0/24")[0]["ip_prefix"]) == "52.94.76.0/22"
input = "2600:1f14:fff:f810:a1c1:f507:a2d1:2dd8"
assert str(test_dig._lookup_data(input)[0]["ipv6_prefix"]) == "2600:1f14:fff:f800::/53"
assert str(test_dig._lookup_data(input)[1]["ipv6_prefix"]) == "2600:1f14::/35"
ipv6_addr = "2600:1f14:fff:f810:a1c1:f507:a2d1:2dd8"
assert str(test_dig._lookup_data(ipv6_addr)[0]["ipv6_prefix"]) == "2600:1f14:fff:f800::/53"
assert str(test_dig._lookup_data(ipv6_addr)[1]["ipv6_prefix"]) == "2600:1f14::/35"
assert str(test_dig._lookup_data("2600:1f14::/36")[0]["ipv6_prefix"]) == "2600:1f14::/35"
with pytest.raises(ValueError) as e:

View File

@@ -49,7 +49,7 @@ def test_get_aws_ip_ranges_cached_invalid_file(mocker, fs, create_cache_dir) ->
response.status_code = 304
mocker.patch("requests.get", return_value=response)
with pytest.raises(digaws.CachedFileException):
with pytest.raises(digaws.CachedFileError):
digaws.get_aws_ip_ranges()
@@ -80,7 +80,7 @@ def test_get_aws_ip_ranges_invalid_status(mocker, fs, create_cache_dir) -> None:
response.status_code = 301
mocker.patch("requests.get", return_value=response)
with pytest.raises(digaws.UnexpectedRequestException) as e:
with pytest.raises(digaws.UnexpectedRequestError) as e:
digaws.get_aws_ip_ranges()
assert str(e.value).startswith("Unexpected response from")