44
55import pytest
66
7- from ix_operator .config import OperatorConfig , OperatorMode , RuntimePaths , TransportBackend
7+ from ix_operator .config import (
8+ IMPLEMENTED_TRANSPORT_BACKENDS ,
9+ OperatorConfig ,
10+ OperatorMode ,
11+ RuntimePaths ,
12+ TransportBackend ,
13+ )
814
915
1016def test_runtime_paths_create_directories (tmp_path : Path ) -> None :
@@ -30,12 +36,12 @@ def test_from_env_uses_defaults(monkeypatch: pytest.MonkeyPatch, tmp_path: Path)
3036 assert config .session_timeout_seconds == 10
3137
3238
33- def test_from_env_parses_hardened_tor_settings (
39+ def test_from_env_parses_hardened_local_settings (
3440 monkeypatch : pytest .MonkeyPatch , tmp_path : Path
3541) -> None :
3642 monkeypatch .setenv ("IX_OPERATOR_RUNTIME_DIR" , str (tmp_path / "runtime" ))
3743 monkeypatch .setenv ("IX_OPERATOR_MODE" , "hardened" )
38- monkeypatch .setenv ("IX_OPERATOR_TRANSPORT" , "tor " )
44+ monkeypatch .setenv ("IX_OPERATOR_TRANSPORT" , "local " )
3945 monkeypatch .setenv ("IX_OPERATOR_LOG_LEVEL" , "warning" )
4046 monkeypatch .setenv ("IX_OPERATOR_TOR_SOCKS_PORT" , "9150" )
4147 monkeypatch .setenv ("IX_OPERATOR_SESSION_TIMEOUT" , "15" )
@@ -44,22 +50,15 @@ def test_from_env_parses_hardened_tor_settings(
4450 config = OperatorConfig .from_env ()
4551
4652 assert config .mode == OperatorMode .HARDENED
47- assert config .transport_backend == TransportBackend .TOR
53+ assert config .transport_backend == TransportBackend .LOCAL
4854 assert config .log_level == "warning"
4955 assert config .tor_socks_port == 9150
5056 assert config .session_timeout_seconds == 15
5157 assert config .packet_size_bytes == 2048
5258
5359
54- def test_hardened_mode_rejects_local_transport (
55- monkeypatch : pytest .MonkeyPatch , tmp_path : Path
56- ) -> None :
57- monkeypatch .setenv ("IX_OPERATOR_RUNTIME_DIR" , str (tmp_path / "runtime" ))
58- monkeypatch .setenv ("IX_OPERATOR_MODE" , "hardened" )
59- monkeypatch .setenv ("IX_OPERATOR_TRANSPORT" , "local" )
60-
61- with pytest .raises (ValueError , match = "hardened mode cannot use the local transport" ):
62- OperatorConfig .from_env ()
60+ def test_implemented_transport_backends_only_include_local () -> None :
61+ assert IMPLEMENTED_TRANSPORT_BACKENDS == (TransportBackend .LOCAL ,)
6362
6463
6564def test_invalid_integer_env_raises (monkeypatch : pytest .MonkeyPatch , tmp_path : Path ) -> None :
0 commit comments