Skip to content

Commit 76ac77d

Browse files
committed
chore: ruff
1 parent 3d63bf9 commit 76ac77d

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
@@ -403,9 +403,9 @@ def is_healthy(ssh) -> bool:
403403
def test_postgrest_is_running(host):
404404
"""Check if postgrest service is running using our SSH connection."""
405405
result = run_ssh_command(host["ssh"], "systemctl is-active postgrest")
406-
assert result["succeeded"] and result["stdout"].strip() == "active", (
407-
"PostgREST service is not running"
408-
)
406+
assert (
407+
result["succeeded"] and result["stdout"].strip() == "active"
408+
), "PostgREST service is not running"
409409

410410

411411
def test_postgrest_responds_to_requests(host):
@@ -547,9 +547,9 @@ def test_postgresql_version(host):
547547
if version_match:
548548
major_version = int(version_match.group(1))
549549
print(f"PostgreSQL major version: {major_version}")
550-
assert major_version >= 14, (
551-
f"PostgreSQL version {major_version} is less than 14"
552-
)
550+
assert (
551+
major_version >= 14
552+
), f"PostgreSQL version {major_version} is less than 14"
553553
else:
554554
assert False, "Could not parse PostgreSQL version number"
555555
else:
@@ -579,9 +579,9 @@ def test_libpq5_version(host):
579579
if version_match:
580580
major_version = int(version_match.group(1))
581581
print(f"libpq5 major version: {major_version}")
582-
assert major_version >= 14, (
583-
f"libpq5 version {major_version} is less than 14"
584-
)
582+
assert (
583+
major_version >= 14
584+
), f"libpq5 version {major_version} is less than 14"
585585
else:
586586
print("Could not parse libpq5 version from dpkg output")
587587
else:
@@ -614,9 +614,9 @@ def test_libpq5_version(host):
614614
if version_match:
615615
major_version = int(version_match.group(1))
616616
print(f"psql/libpq major version: {major_version}")
617-
assert major_version >= 14, (
618-
f"psql/libpq version {major_version} is less than 14"
619-
)
617+
assert (
618+
major_version >= 14
619+
), f"psql/libpq version {major_version} is less than 14"
620620
else:
621621
print("Could not parse psql version")
622622

@@ -706,9 +706,9 @@ def test_pam_postgresql_config(host):
706706
perms = result["stdout"].strip()
707707
print(f"PAM config permissions: {perms}")
708708
# Should be owned by postgres:postgres with 664 permissions
709-
assert "postgres postgres" in perms, (
710-
"PAM config not owned by postgres:postgres"
711-
)
709+
assert (
710+
"postgres postgres" in perms
711+
), "PAM config not owned by postgres:postgres"
712712
else:
713713
print("\nPAM config file not found")
714714
assert False, "PAM configuration file /etc/pam.d/postgresql not found"
@@ -998,9 +998,7 @@ def test_postgrest_read_only_session_attrs(host):
998998
print(
999999
f"\nFound 'session is not read-only' errors in PostgREST logs:\n{result['stdout']}"
10001000
)
1001-
assert False, (
1002-
"PostgREST logs contain 'session is not read-only' errors even though PostgreSQL is configured for read-only mode"
1003-
)
1001+
assert False, "PostgREST logs contain 'session is not read-only' errors even though PostgreSQL is configured for read-only mode"
10041002
else:
10051003
print("\nNo 'session is not read-only' errors found in PostgREST logs")
10061004

0 commit comments

Comments
 (0)