Private
Public Access
conductor(plan): mark Phase 3 (download_media.py) complete [f503eb5d]
This commit is contained in:
@@ -126,11 +126,11 @@ git commit -m "feat(twitter_threads): render_markdown.py — YAML front-matter +
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Phase 3: `download_media.py` (the media downloader)
|
## Phase 3: `download_media.py` (the media downloader) [checkpoint: f503eb5d]
|
||||||
|
|
||||||
Focus: download the media files referenced by a `ThreadData`. Mock the HTTP in tests; real network only at runtime.
|
Focus: download the media files referenced by a `ThreadData`. Mock the HTTP in tests; real network only at runtime.
|
||||||
|
|
||||||
- [ ] **Task 3.1: Write failing tests for `download_media.py`**
|
- [x] **Task 3.1: Write failing tests for `download_media.py`**
|
||||||
|
|
||||||
WHERE: `tests/test_twitter_threads_media.py`
|
WHERE: `tests/test_twitter_threads_media.py`
|
||||||
WHAT: 4+ tests:
|
WHAT: 4+ tests:
|
||||||
@@ -141,7 +141,7 @@ WHAT: 4+ tests:
|
|||||||
HOW: Mock `urllib.request.urlopen` via `unittest.mock.patch` (this is a boundary test — the HTTP boundary — so mocking is allowed per the structural testing contract). Use `tests/artifacts/twitter_threads_media_<test_name>/` as the output dir per the workspace-paths convention.
|
HOW: Mock `urllib.request.urlopen` via `unittest.mock.patch` (this is a boundary test — the HTTP boundary — so mocking is allowed per the structural testing contract). Use `tests/artifacts/twitter_threads_media_<test_name>/` as the output dir per the workspace-paths convention.
|
||||||
VERIFY: `uv run pytest tests/test_twitter_threads_media.py` FAILS.
|
VERIFY: `uv run pytest tests/test_twitter_threads_media.py` FAILS.
|
||||||
|
|
||||||
- [ ] **Task 3.2: Implement `download_media.py`**
|
- [x] **Task 3.2: Implement `download_media.py`**
|
||||||
|
|
||||||
WHERE: `scripts/twitter_threads/download_media.py`
|
WHERE: `scripts/twitter_threads/download_media.py`
|
||||||
WHAT: The `download_media(thread: ThreadData, output_dir: Path) -> Result[list[Path], ErrorInfo]` function.
|
WHAT: The `download_media(thread: ThreadData, output_dir: Path) -> Result[list[Path], ErrorInfo]` function.
|
||||||
@@ -156,7 +156,7 @@ HOW:
|
|||||||
- Use only stdlib (`urllib.request`, `pathlib`, `dataclasses`). No `requests`.
|
- Use only stdlib (`urllib.request`, `pathlib`, `dataclasses`). No `requests`.
|
||||||
VERIFY: `uv run pytest tests/test_twitter_threads_media.py` PASSES.
|
VERIFY: `uv run pytest tests/test_twitter_threads_media.py` PASSES.
|
||||||
|
|
||||||
- [ ] **Task 3.3: Commit Phase 3**
|
- [x] **Task 3.3: Commit Phase 3**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git add scripts/twitter_threads/download_media.py tests/test_twitter_threads_media.py
|
git add scripts/twitter_threads/download_media.py tests/test_twitter_threads_media.py
|
||||||
|
|||||||
Reference in New Issue
Block a user