Skip to content

Commit 1bcac36

Browse files
committed
Tests for positive case
1 parent e5baf4a commit 1bcac36

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

tests/unit/models/config/test_quota_scheduler_config.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""Unit tests for QuotaSchedulerConfig model."""
22

3+
from typing import Any
4+
35
import pytest
46
from pydantic import ValidationError
57

@@ -77,3 +79,35 @@ def test_quota_scheduler_custom_configuration_negative_reconnection_delay() -> N
7779
QuotaSchedulerConfiguration(
7880
database_reconnection_delay=-10
7981
) # pyright: ignore[reportCallIssue]
82+
83+
84+
correct_configurations = [
85+
{
86+
"period": 959,
87+
"database_reconnection_count": 125,
88+
"database_reconnection_delay": 94,
89+
},
90+
{
91+
"period": 1,
92+
"database_reconnection_count": 125,
93+
"database_reconnection_delay": 94,
94+
},
95+
{
96+
"period": 959,
97+
"database_reconnection_count": 1,
98+
"database_reconnection_delay": 94,
99+
},
100+
{
101+
"period": 959,
102+
"database_reconnection_count": 125,
103+
"database_reconnection_delay": 1,
104+
},
105+
]
106+
107+
108+
@pytest.mark.parametrize("config_dict", correct_configurations)
109+
def test_configure_quota_scheduler_from_dict(
110+
config_dict: dict[str, Any],
111+
) -> None:
112+
"""Test the configuration initialization from dictionary with config values."""
113+
QuotaSchedulerConfiguration(**config_dict)

0 commit comments

Comments
 (0)