Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(python): update ruff ( 0.8.0 → 0.9.0 ) #19

Merged
merged 2 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dev = [
"pytest~=8.3.3",
"pytest-cov~=6.0.0",
"responses~=0.25.3",
"ruff~=0.8.0"
"ruff~=0.9.0"
]

[build-system]
Expand Down
2 changes: 1 addition & 1 deletion src/octodns_infomaniak/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __init__(self, token):
session.headers.update(
{
"Authorization": f"Bearer {token}",
"User-Agent": f'octodns/{version("octodns")} octodns-infomaniak/{version(__package__)}',
"User-Agent": f"octodns/{version('octodns')} octodns-infomaniak/{version(__package__)}",
}
)
self._session = session
Expand Down
24 changes: 12 additions & 12 deletions tests/test_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,31 @@ def test_http_error():

# 400
with responses.RequestsMock() as mock:
mock.get(f'{BASE_API_URL}zones/{zone_name.rstrip(".")}/records', status=400)
mock.get(f"{BASE_API_URL}zones/{zone_name.rstrip('.')}/records", status=400)

with pytest.raises(InfomaniakClientBadRequest):
zone = Zone(zone_name, [])
provider.populate(zone)

# 401
with responses.RequestsMock() as mock:
mock.get(f'{BASE_API_URL}zones/{zone_name.rstrip(".")}/records', status=401)
mock.get(f"{BASE_API_URL}zones/{zone_name.rstrip('.')}/records", status=401)

with pytest.raises(InfomaniakClientUnauthorized):
zone = Zone(zone_name, [])
provider.populate(zone)

# 403
with responses.RequestsMock() as mock:
mock.get(f'{BASE_API_URL}zones/{zone_name.rstrip(".")}/records', status=403)
mock.get(f"{BASE_API_URL}zones/{zone_name.rstrip('.')}/records", status=403)

with pytest.raises(InfomaniakClientForbidden):
zone = Zone(zone_name, [])
provider.populate(zone)

# 404
with responses.RequestsMock() as mock:
mock.get(f'{BASE_API_URL}zones/{zone_name.rstrip(".")}/records', status=404)
mock.get(f"{BASE_API_URL}zones/{zone_name.rstrip('.')}/records", status=404)

with pytest.raises(InfomaniakClientNotFound):
zone = Zone(zone_name, [])
Expand All @@ -63,11 +63,11 @@ def test_populate_empty_zone():
with responses.RequestsMock() as mock:
with open("tests/fixtures/empty_example.test.json") as f:
mock.get(
f"{BASE_API_URL}zones/{zone_name.rstrip(".")}/records",
f"{BASE_API_URL}zones/{zone_name.rstrip('.')}/records",
status=200,
headers={
"Authorization": f"Bearer {TOKEN}",
"User-Agent": f'octodns/{version("octodns")} octodns-infomaniak/{version("octodns-infomaniak")}',
"User-Agent": f"octodns/{version('octodns')} octodns-infomaniak/{version('octodns-infomaniak')}",
},
json=json.loads(f.read()),
)
Expand Down Expand Up @@ -245,7 +245,7 @@ def test_populate_zone():
with responses.RequestsMock() as mock:
with open("tests/fixtures/get_example.test.json") as f:
mock.get(
f"{BASE_API_URL}zones/{zone_name.rstrip(".")}/records",
f"{BASE_API_URL}zones/{zone_name.rstrip('.')}/records",
status=200,
json=json.loads(f.read()),
)
Expand Down Expand Up @@ -423,7 +423,7 @@ def test_apply_full_zone():
with responses.RequestsMock() as mock:
with open("tests/fixtures/empty_example.test.json") as f:
mock.get(
f"{BASE_API_URL}zones/{zone_name.rstrip(".")}/records",
f"{BASE_API_URL}zones/{zone_name.rstrip('.')}/records",
status=200,
json=json.loads(f.read()),
)
Expand All @@ -432,7 +432,7 @@ def test_apply_full_zone():
datas = json.loads(f.read())
for data in datas:
mock.post(
f"{BASE_API_URL}zones/{zone_name.rstrip(".")}/records",
f"{BASE_API_URL}zones/{zone_name.rstrip('.')}/records",
status=201,
match=[matchers.json_params_matcher(data)],
json={},
Expand Down Expand Up @@ -488,7 +488,7 @@ def test_apply_update_zone():
with responses.RequestsMock() as mock:
with open("tests/fixtures/get_example2.test.json") as f:
mock.get(
f"{BASE_API_URL}zones/{zone_name.rstrip(".")}/records",
f"{BASE_API_URL}zones/{zone_name.rstrip('.')}/records",
status=200,
json=json.loads(f.read()),
)
Expand All @@ -497,7 +497,7 @@ def test_apply_update_zone():
datas = json.loads(f.read())
for data in datas:
mock.post(
f"{BASE_API_URL}zones/{zone_name.rstrip(".")}/records",
f"{BASE_API_URL}zones/{zone_name.rstrip('.')}/records",
status=201,
match=[matchers.json_params_matcher(data)],
json={},
Expand All @@ -507,7 +507,7 @@ def test_apply_update_zone():
datas = json.loads(f.read())
for data in datas:
mock.delete(
f"{BASE_API_URL}zones/{zone_name.rstrip(".")}/records/{data}",
f"{BASE_API_URL}zones/{zone_name.rstrip('.')}/records/{data}",
status=200,
json={},
)
Expand Down
40 changes: 20 additions & 20 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading