Skip to content

Commit 1cad715

Browse files
committed
missing
1 parent f4ff7ac commit 1cad715

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

packages/settings-library/tests/data/.env-compact

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
APP_HOST=localhost
44
APP_PORT=80
55
APP_OPTIONAL_ADDON='{"MODULE_VALUE": 10, "MODULE_VALUE_DEFAULT": 42}'
6-
APP_REQUIRED_PLUGIN='{"POSTGRES_HOST": "localhost", "POSTGRES_PORT": 5432, "POSTGRES_USER": "foo", "POSTGRES_PASSWORD": "**********", "POSTGRES_DB": "foodb", "POSTGRES_MINSIZE": 2, "POSTGRES_MAX_POOLSIZE": 10, "POSTGRES_MAX_OVERFLOW": 20, "POSTGRES_MAXSIZE": 50, "POSTGRES_CLIENT_NAME": "None"}'
6+
APP_REQUIRED_PLUGIN='{"POSTGRES_HOST": "localhost", "POSTGRES_PORT": 5432, "POSTGRES_USER": "foo", "POSTGRES_PASSWORD": "**********", "POSTGRES_DB": "foodb", "POSTGRES_MINSIZE": 1, "POSTGRES_MAX_POOLSIZE": 10, "POSTGRES_MAX_OVERFLOW": 20, "POSTGRES_MAXSIZE": 50, "POSTGRES_CLIENT_NAME": "None"}'

packages/settings-library/tests/test_base_w_postgres.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ class _FakePostgresSettings(BaseCustomSettings):
5555
POSTGRES_PASSWORD: str
5656

5757
POSTGRES_DB: str
58-
POSTGRES_MINSIZE: Annotated[int, Field(ge=2)] = 2
59-
POSTGRES_MAXSIZE: Annotated[int, Field(ge=2)] = 50
58+
POSTGRES_MINSIZE: Annotated[int, Field(ge=1)] = 1
59+
POSTGRES_MAXSIZE: Annotated[int, Field(ge=1)] = 50
60+
POSTGRES_MAX_POOLSIZE: int = 10
61+
POSTGRES_MAX_OVERFLOW: Annotated[int, Field(ge=0)] = 20
6062

6163
POSTGRES_CLIENT_NAME: Annotated[
6264
str | None,
@@ -126,7 +128,6 @@ class S5(BaseCustomSettings):
126128
def test_parse_from_empty_envs(
127129
postgres_envvars_unset: None, model_classes_factory: Callable
128130
):
129-
130131
S1, S2, S3, S4, S5 = model_classes_factory()
131132

132133
with pytest.raises(ValidationError, match="WEBSERVER_POSTGRES") as exc_info:
@@ -160,7 +161,6 @@ def test_parse_from_individual_envs(
160161
monkeypatch: pytest.MonkeyPatch,
161162
model_classes_factory: Callable,
162163
):
163-
164164
S1, S2, S3, S4, S5 = model_classes_factory()
165165

166166
# environment
@@ -232,7 +232,6 @@ def test_parse_from_individual_envs(
232232
def test_parse_compact_env(
233233
postgres_envvars_unset: None, monkeypatch, model_classes_factory
234234
):
235-
236235
S1, S2, S3, S4, S5 = model_classes_factory()
237236

238237
# environment
@@ -348,7 +347,6 @@ def test_parse_compact_env(
348347
def test_parse_from_mixed_envs(
349348
postgres_envvars_unset: None, monkeypatch, model_classes_factory
350349
):
351-
352350
S1, S2, S3, S4, S5 = model_classes_factory()
353351

354352
# environment
@@ -480,7 +478,6 @@ def test_parse_from_mixed_envs(
480478
def test_toggle_plugin_1(
481479
postgres_envvars_unset: None, monkeypatch, model_classes_factory
482480
):
483-
484481
*_, S4, S5 = model_classes_factory()
485482

486483
# empty environ
@@ -543,7 +540,6 @@ def test_toggle_plugin_3(
543540
def test_toggle_plugin_4(
544541
postgres_envvars_unset: None, monkeypatch, model_classes_factory
545542
):
546-
547543
*_, S4, S5 = model_classes_factory()
548544
JSON_VALUE = '{"POSTGRES_HOST":"pg2", "POSTGRES_USER":"test2", "POSTGRES_PASSWORD":"shh2", "POSTGRES_DB":"db2"}'
549545

@@ -573,7 +569,6 @@ def test_toggle_plugin_4(
573569
)
574570

575571
with monkeypatch.context() as patch:
576-
577572
# Enables both but remove individuals
578573
setenvs_from_envfile(
579574
patch,

0 commit comments

Comments
 (0)