feat: Config and pluggable auth stub (manual/none)
This commit is contained in:
@@ -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")
|
||||
Reference in New Issue
Block a user