mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-09-30 08:03:15 +00:00
Applies the plan's C5 step: git mv every test per the domain-reorg
move-map (movemap-m50.txt) into tests/{agent,analyzer,auth,dashboard,
github,middleware,models,reviewer,sandbox,slack,tools,webhooks}/, plus
the 13 fork-only placements from the scoping report §2c (Atlassian
webhook tests -> tests/webhooks/, test_atlassian_connect.py and
test_auth_error_leak.py -> tests/auth/, jira/confluence util tests ->
tests/tools/, test_repo_binding_isolation.py -> tests/sandbox/,
bot-identity/autofix tests -> tests/github/).
Path-only move: the only content edits are parents[1] -> parents[2]
fixes in test_e2b_integration.py and test_daytona_integration.py,
required because their __file__-relative ROOT path gained one more
directory level in the move.
Monkeypatch retargets for these files were already completed in C4;
none remained outstanding here.
35 lines
1.1 KiB
Python
35 lines
1.1 KiB
Python
from __future__ import annotations
|
|
|
|
from unittest.mock import patch
|
|
|
|
import pytest
|
|
|
|
from agent.utils import api_standards_skill
|
|
|
|
|
|
@pytest.mark.asyncio
|
|
async def test_fetch_returns_skill_content() -> None:
|
|
with patch.object(
|
|
api_standards_skill,
|
|
"_pull_api_standards_skill_sync",
|
|
return_value="Use /v1/ prefixes.",
|
|
):
|
|
content = await api_standards_skill.fetch_api_standards_skill("api-standards")
|
|
assert content == "Use /v1/ prefixes."
|
|
|
|
|
|
@pytest.mark.asyncio
|
|
async def test_fetch_returns_none_on_error() -> None:
|
|
def _boom(_handle: str) -> str | None:
|
|
raise RuntimeError("no api key")
|
|
|
|
with patch.object(api_standards_skill, "_pull_api_standards_skill_sync", side_effect=_boom):
|
|
content = await api_standards_skill.fetch_api_standards_skill("api-standards")
|
|
assert content is None
|
|
|
|
|
|
@pytest.mark.asyncio
|
|
async def test_fetch_returns_none_when_no_handle_configured() -> None:
|
|
with patch.object(api_standards_skill, "API_STANDARDS_SKILL_HANDLE", ""):
|
|
content = await api_standards_skill.fetch_api_standards_skill("")
|
|
assert content is None
|