Skip to content

Commit defcde6

Browse files
committed
Fixed issues found by linters
1 parent 52ca427 commit defcde6

2 files changed

Lines changed: 17 additions & 3 deletions

File tree

src/models/config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1368,7 +1368,9 @@ class QuotaHandlersConfiguration(ConfigurationBase):
13681368
)
13691369

13701370
scheduler: QuotaSchedulerConfiguration = Field(
1371-
default_factory=lambda: QuotaSchedulerConfiguration(period=1),
1371+
default_factory=lambda: QuotaSchedulerConfiguration(
1372+
period=1, database_reconnection_count=10, database_reconnection_delay=1
1373+
),
13721374
title="Quota scheduler",
13731375
description="Quota scheduler configuration",
13741376
)

tests/unit/models/config/test_quota_scheduler_config.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,25 @@ def test_quota_scheduler_custom_configuration_negative_period() -> None:
4242
QuotaSchedulerConfiguration(period=-10)
4343

4444

45+
def test_quota_scheduler_custom_configuration_zero_reconnection_count() -> None:
46+
"""Test that zero database reconnection count value raises ValidationError."""
47+
with pytest.raises(ValidationError, match="Input should be greater than 0"):
48+
QuotaSchedulerConfiguration(database_reconnection_count=0)
49+
50+
4551
def test_quota_scheduler_custom_configuration_negative_reconnection_count() -> None:
46-
"""Test that negative period value raises ValidationError."""
52+
"""Test that negative database reconnection count value raises ValidationError."""
4753
with pytest.raises(ValidationError, match="Input should be greater than 0"):
4854
QuotaSchedulerConfiguration(database_reconnection_count=-10)
4955

5056

57+
def test_quota_scheduler_custom_configuration_zero_reconnection_delay() -> None:
58+
"""Test that zero database reconnection delay value raises ValidationError."""
59+
with pytest.raises(ValidationError, match="Input should be greater than 0"):
60+
QuotaSchedulerConfiguration(database_reconnection_delay=0)
61+
62+
5163
def test_quota_scheduler_custom_configuration_negative_reconnection_delay() -> None:
52-
"""Test that negative period value raises ValidationError."""
64+
"""Test that negative database reconnection delay value raises ValidationError."""
5365
with pytest.raises(ValidationError, match="Input should be greater than 0"):
5466
QuotaSchedulerConfiguration(database_reconnection_delay=-10)

0 commit comments

Comments
 (0)