feat: Config and pluggable auth stub (manual/none)

This commit is contained in:
2026-06-01 00:02:38 +08:00
parent 2b5e43a64f
commit c6d349c505
2 changed files with 88 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
import pytest
from auto_reverse.config import Config, ManualPauseAuth, NoAuth, make_auth
def test_config_derives_target_host():
cfg = Config(target_url="https://app.example.com/dashboard")
assert cfg.target_host == "app.example.com"
def test_config_scope_hosts_includes_target_plus_extra():
cfg = Config(target_url="https://app.example.com", scope_hosts={"api.example.com"})
assert cfg.all_scope_hosts() == {"app.example.com", "api.example.com"}
def test_default_model():
assert Config(target_url="https://x.com").model == "claude-opus-4-8"
def test_make_auth_returns_strategy():
assert isinstance(make_auth("manual"), ManualPauseAuth)
assert isinstance(make_auth("none"), NoAuth)
def test_make_auth_unknown_raises():
with pytest.raises(ValueError):
make_auth("oauth-magic")