17 lines
488 B
Python
17 lines
488 B
Python
import pytest
|
|
from pydantic import ValidationError
|
|
|
|
from zhixing_server.bootstrap.config import Settings
|
|
|
|
|
|
def test_market_data_workers_default_to_eight(monkeypatch: pytest.MonkeyPatch) -> None:
|
|
monkeypatch.delenv("ZHIXING_MARKET_DATA_MAX_WORKERS", raising=False)
|
|
settings = Settings()
|
|
|
|
assert settings.market_data_max_workers == 8
|
|
|
|
|
|
def test_market_data_workers_must_be_positive() -> None:
|
|
with pytest.raises(ValidationError):
|
|
Settings(market_data_max_workers=0)
|