Skip to content
Merged

BE/FE #286

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion backend/tests/test_worker/test_github_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,21 @@ def test_completed_persists_mapped_result_content(
):
"""フェーズC: 成功時に map_pipeline_result の出力が cache.result へ
そのまま永続化され、error/warning がクリアされること(内容まで検証)。"""
from app.schemas.github_link import ContributionCalendar, ContributionDay

user, cache = self._make_user_and_cache(db_session, "github:content-user")
# 前回失敗の痕跡が成功時にクリアされることも併せて確認する
cache.error_message = "前回の失敗"
cache.warning_message = "前回の警告"
db_session.commit()

repos = self._sample_repos()
# コントリビューション取得が成功するケース。これにより新たな警告は出ず、
# 前回の warning_message がクリアされることを純粋に検証できる。
calendar = ContributionCalendar(
total_contributions=7,
weeks=[[ContributionDay(date="2024-03-01", count=3, level=2)]],
)
sentinel_result = {
"skills": [{"name": "Python", "score": 80}],
"summary": "集計結果",
Expand All @@ -116,7 +124,7 @@ def test_completed_persists_mapped_result_content(
patch(
"app.services.intelligence.github_link_service.fetch_contribution_calendar",
new_callable=AsyncMock,
return_value=None,
return_value=calendar,
),
patch("app.services.progress_service.set_progress", new_callable=AsyncMock),
patch(
Expand Down
Loading