test: split endpoint resolver tests (#4957)

This commit is contained in:
Alexandre Teixeira
2026-06-27 23:49:43 +01:00
committed by GitHub
parent fbe3a0d73b
commit 259662e914
3 changed files with 84 additions and 80 deletions
+16
View File
@@ -0,0 +1,16 @@
"""Tests for endpoint_resolver — request header construction."""
from src.endpoint_resolver import build_headers
class TestBuildHeaders:
def test_no_key(self):
assert build_headers(None, "https://api.openai.com/v1") == {}
def test_openai_bearer(self):
assert build_headers("sk-abc", "https://api.openai.com/v1") == {"Authorization": "Bearer sk-abc"}
def test_anthropic_headers(self):
assert build_headers("sk-ant-abc", "https://api.anthropic.com") == {"x-api-key": "sk-ant-abc", "anthropic-version": "2023-06-01"}
def test_empty_key(self):
assert build_headers("", "https://api.openai.com/v1") == {}