Skip to content

Commit 0b0e0f3

Browse files
committed
Updated docstrings in tests/unit/models/config/test_postgresql_database_configuration.py
1 parent ffd2d52 commit 0b0e0f3

1 file changed

Lines changed: 21 additions & 2 deletions

File tree

tests/unit/models/config/test_postgresql_database_configuration.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,15 @@ def test_postgresql_database_configuration_namespace_specification() -> None:
5050

5151

5252
def test_postgresql_database_configuration_port_setting(subtests: SubTests) -> None:
53-
"""Test the PostgreSQLDatabaseConfiguration model."""
53+
"""Test the PostgreSQLDatabaseConfiguration model.
54+
55+
Validate port handling of PostgreSQLDatabaseConfiguration.
56+
57+
Checks three scenarios:
58+
- A valid explicit port (1234) is preserved on the model.
59+
- A negative port raises ValidationError with message "Input should be greater than 0".
60+
- A port >= 65536 raises ValueError with message "Port value should be less than 65536".
61+
"""
5462
with subtests.test(msg="Correct port value"):
5563
c = PostgreSQLDatabaseConfiguration(
5664
db="db", user="user", password="password", port=1234
@@ -72,7 +80,18 @@ def test_postgresql_database_configuration_port_setting(subtests: SubTests) -> N
7280

7381

7482
def test_postgresql_database_configuration_ca_cert_path(subtests: SubTests) -> None:
75-
"""Test the PostgreSQLDatabaseConfiguration model."""
83+
"""Test the PostgreSQLDatabaseConfiguration model.
84+
85+
Validate ca_cert_path handling in PostgreSQLDatabaseConfiguration.
86+
87+
Verifies two behaviors using subtests:
88+
- When `ca_cert_path` points to an existing file, the value is preserved on the model.
89+
- When `ca_cert_path` points to a non-existent path, a ValidationError is
90+
raised with the message "Path does not point to a file".
91+
92+
Parameters:
93+
subtests (SubTests): Test helper providing subtest contexts.
94+
"""
7695
with subtests.test(msg="Path exists"):
7796
c = PostgreSQLDatabaseConfiguration(
7897
db="db",

0 commit comments

Comments
 (0)