| 12345678910111213141516171819202122232425262728293031 |
- import pytest
- import okx_codex_trader
- from okx_codex_trader.config import load_config
- def test_package_exports_version():
- assert okx_codex_trader.__version__ == "0.1.0"
- def test_load_config_requires_okx_credentials(monkeypatch):
- monkeypatch.delenv("OKX_API_KEY", raising=False)
- monkeypatch.delenv("OKX_API_SECRET", raising=False)
- monkeypatch.delenv("OKX_API_PASSPHRASE", raising=False)
- with pytest.raises(ValueError):
- load_config()
- def test_load_config_uses_explicit_env_mapping():
- config = load_config(
- {
- "OKX_API_KEY": "key",
- "OKX_API_SECRET": "secret",
- "OKX_API_PASSPHRASE": "passphrase",
- }
- )
- assert config.api_key == "key"
- assert config.api_secret == "secret"
- assert config.api_passphrase == "passphrase"
|