Sprint 002: Ingest duration & view count, FTS search, infinite scroll pagination, and transcript accordion
Deploy t-youtube / Build & Deploy (push) Failing after 1s
Deploy t-youtube / Build & Deploy (push) Failing after 1s
This commit is contained in:
@@ -43,8 +43,18 @@ def _mock_youtube_build(sub_channels=None, video_data=None):
|
||||
"channelId": "chan001",
|
||||
"thumbnails": {"high": {"url": f"https://img.youtube.com/vi/{vid}/hqdefault.jpg"}},
|
||||
"publishTime": "2026-06-01T00:00:00Z",
|
||||
"contentDetails": {"duration": "PT5M30S"},
|
||||
"statistics": {"viewCount": "1250"},
|
||||
})
|
||||
snippet = {k: v for k, v in data.items() if k not in ("contentDetails", "statistics")}
|
||||
content_details = data.get("contentDetails", {"duration": "PT5M30S"})
|
||||
statistics = data.get("statistics", {"viewCount": "1250"})
|
||||
items.append({
|
||||
"id": vid,
|
||||
"snippet": snippet,
|
||||
"contentDetails": content_details,
|
||||
"statistics": statistics
|
||||
})
|
||||
items.append({"id": vid, "snippet": data})
|
||||
return MagicMock(execute=MagicMock(return_value={"items": items}))
|
||||
|
||||
svc = MagicMock()
|
||||
@@ -115,8 +125,12 @@ async def test_fetch_new_videos(test_db):
|
||||
assert len(rows) == 2
|
||||
assert rows[0]["video_id"] == "vid001"
|
||||
assert rows[0]["title"] == "First Video"
|
||||
assert rows[0]["duration"] == 330 # PT5M30S = 330s
|
||||
assert rows[0]["view_count"] == 1250
|
||||
assert rows[1]["video_id"] == "vid002"
|
||||
assert rows[1]["title"] == "Second Video"
|
||||
assert rows[1]["duration"] == 330
|
||||
assert rows[1]["view_count"] == 1250
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
||||
Reference in New Issue
Block a user