Skip to content

Commit 2b66006

Browse files
committed
chore: ruff
1 parent 4e9811b commit 2b66006

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

testinfra/test_ami_nix.py

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -427,9 +427,9 @@ def is_healthy(ssh) -> bool:
427427
def test_postgrest_is_running(host):
428428
"""Check if postgrest service is running using our SSH connection."""
429429
result = run_ssh_command(host["ssh"], "systemctl is-active postgrest")
430-
assert result["succeeded"] and result["stdout"].strip() == "active", (
431-
"PostgREST service is not running"
432-
)
430+
assert (
431+
result["succeeded"] and result["stdout"].strip() == "active"
432+
), "PostgREST service is not running"
433433

434434

435435
def test_postgrest_responds_to_requests(host):
@@ -552,9 +552,9 @@ def test_postgresql_version(host):
552552
if version_match:
553553
major_version = int(version_match.group(1))
554554
print(f"PostgreSQL major version: {major_version}")
555-
assert major_version >= 14, (
556-
f"PostgreSQL version {major_version} is less than 14"
557-
)
555+
assert (
556+
major_version >= 14
557+
), f"PostgreSQL version {major_version} is less than 14"
558558
else:
559559
assert False, "Could not parse PostgreSQL version number"
560560
else:
@@ -584,9 +584,9 @@ def test_libpq5_version(host):
584584
if version_match:
585585
major_version = int(version_match.group(1))
586586
print(f"libpq5 major version: {major_version}")
587-
assert major_version >= 14, (
588-
f"libpq5 version {major_version} is less than 14"
589-
)
587+
assert (
588+
major_version >= 14
589+
), f"libpq5 version {major_version} is less than 14"
590590
else:
591591
print("Could not parse libpq5 version from dpkg output")
592592
else:
@@ -619,9 +619,9 @@ def test_libpq5_version(host):
619619
if version_match:
620620
major_version = int(version_match.group(1))
621621
print(f"psql/libpq major version: {major_version}")
622-
assert major_version >= 14, (
623-
f"psql/libpq version {major_version} is less than 14"
624-
)
622+
assert (
623+
major_version >= 14
624+
), f"psql/libpq version {major_version} is less than 14"
625625
else:
626626
print("Could not parse psql version")
627627

@@ -711,9 +711,9 @@ def test_pam_postgresql_config(host):
711711
perms = result["stdout"].strip()
712712
print(f"PAM config permissions: {perms}")
713713
# Should be owned by postgres:postgres with 664 permissions
714-
assert "postgres postgres" in perms, (
715-
"PAM config not owned by postgres:postgres"
716-
)
714+
assert (
715+
"postgres postgres" in perms
716+
), "PAM config not owned by postgres:postgres"
717717
else:
718718
print("\nPAM config file not found")
719719
assert False, "PAM configuration file /etc/pam.d/postgresql not found"
@@ -1003,9 +1003,7 @@ def test_postgrest_read_only_session_attrs(host):
10031003
print(
10041004
f"\nFound 'session is not read-only' errors in PostgREST logs:\n{result['stdout']}"
10051005
)
1006-
assert False, (
1007-
"PostgREST logs contain 'session is not read-only' errors even though PostgreSQL is configured for read-only mode"
1008-
)
1006+
assert False, "PostgREST logs contain 'session is not read-only' errors even though PostgreSQL is configured for read-only mode"
10091007
else:
10101008
print("\nNo 'session is not read-only' errors found in PostgREST logs")
10111009

0 commit comments

Comments
 (0)