mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-01 17:00:21 +08:00
feat: Antigravity 和 Codex 服务支持
- 新增 Antigravity 服务:签名缓存、URL 可用性检测、信封处理 - 新增 Codex 服务:信封处理、元数据收集器 - 重构 provider transport 支持新的服务架构 - 新增 stream_bridge 和 upstream_stream_bridge 处理流式响应 - 优化 OAuth 工具函数 - 添加相关测试用例
This commit is contained in:
38
tests/core/test_provider_oauth_utils_antigravity.py
Normal file
38
tests/core/test_provider_oauth_utils_antigravity.py
Normal file
@@ -0,0 +1,38 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from unittest.mock import AsyncMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
from src.core.provider_oauth_utils import enrich_auth_config
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_enrich_auth_config_antigravity_adds_project_id_and_email() -> None:
|
||||
auth_config: dict[str, object] = {}
|
||||
token_response: dict[str, object] = {}
|
||||
|
||||
with (
|
||||
patch("src.core.provider_oauth_utils.fetch_google_email", AsyncMock(return_value="u@example.com")),
|
||||
patch(
|
||||
"src.services.antigravity.client.load_code_assist",
|
||||
AsyncMock(
|
||||
return_value={
|
||||
"cloudaicompanionProject": "project-1",
|
||||
"currentTier": {"tierType": "PAID"},
|
||||
}
|
||||
),
|
||||
),
|
||||
):
|
||||
out = await enrich_auth_config(
|
||||
provider_type="antigravity",
|
||||
auth_config=auth_config, # in-place
|
||||
token_response=token_response,
|
||||
access_token="tok",
|
||||
proxy_config=None,
|
||||
)
|
||||
|
||||
assert out["email"] == "u@example.com"
|
||||
assert out["project_id"] == "project-1"
|
||||
assert out["tier"] == "PAID"
|
||||
|
||||
Reference in New Issue
Block a user