Add edge-case test coverage #36

Manually merged
marvin8 merged 2 commits from feat/issue-29-edge-case-tests into main 2026-08-20 04:15:14 +00:00
Collaborator

Closes #29

Adds edge-case test coverage (all green — no bugs surfaced, this is coverage hardening):

  • Emoji / non-ASCII titles — filename parsing (parse_episode_filename) and feed <title> output both preserve Unicode titles.
  • UTF-8 BOM in NFO — parse_episode_nfo accepts a sidecar that starts with a BOM.
  • Long titles (>255 chars) — feed item title is emitted untruncated.
  • 100+ episodes — build_feed_xml produces all 120 items without error.
Closes #29 Adds edge-case test coverage (all green — no bugs surfaced, this is coverage hardening): - **Emoji / non-ASCII titles** — filename parsing (`parse_episode_filename`) and feed `<title>` output both preserve Unicode titles. - **UTF-8 BOM in NFO** — `parse_episode_nfo` accepts a sidecar that starts with a BOM. - **Long titles (>255 chars)** — feed item title is emitted untruncated. - **100+ episodes** — `build_feed_xml` produces all 120 items without error.
✅ add edge-case tests for emoji, BOM, long titles, and 100+ episodes
All checks were successful
/ gitleaks (pull_request) Successful in 18s
/ checks (pull_request) Successful in 2m35s
/ publish (pull_request) Has been skipped
/ deploy-docs (pull_request) Has been skipped
/ pr-review (pull_request) Successful in 4m29s
a05339d2f3
forgejo-actions left a comment

WuMing

Found 1 issue(s). See inline comments below.

## WuMing Found **1** issue(s). See inline comments below.
@ -560,0 +607,4 @@
) -> None:
episodes = [
Episode(
audio_path=channel_dir / f"2024-01-01 - Episode {index:03d}.opus",

code [MEDIUM]

The 120 Episode objects reference audio files under channel_dir, but no files are created. Existing tests use _make_episode to create placeholder audio files. If build_feed_xml reads audio file metadata (e.g., enclosure length via stat), this test will fail with FileNotFoundError; otherwise it bypasses normal fixture setup and weakens coverage. Create a placeholder file for each episode or use _make_episode.

**code** [MEDIUM] The 120 Episode objects reference audio files under channel_dir, but no files are created. Existing tests use _make_episode to create placeholder audio files. If build_feed_xml reads audio file metadata (e.g., enclosure length via stat), this test will fail with FileNotFoundError; otherwise it bypasses normal fixture setup and weakens coverage. Create a placeholder file for each episode or use _make_episode. <!-- wuming:sha256:066214513ba8fe0821d6b50fc8c5079dce9c0899b6baa9050dbbe88207895416 -->
marvin8 marked this conversation as resolved
✅ create placeholder audio files in the 100+ episodes test
All checks were successful
/ gitleaks (pull_request) Successful in 14s
/ checks (pull_request) Successful in 2m0s
/ publish (pull_request) Has been skipped
/ deploy-docs (pull_request) Has been skipped
/ pr-review (pull_request) Successful in 4m41s
8e036f7d67
Author
Collaborator

tests/test_feed.py line 610

The 120 Episode objects reference audio files under channel_dir, but no files are created…

✅ Fixed in commit 8e036f7 — each episode now writes a placeholder audio file, so build_feed_xml exercises the stat() size path (0 for empty files) instead of the exists() fallback.

[`tests/test_feed.py` line 610](https://forge.marvin8.zone/marvin8/sub2pod/pulls/36#issuecomment-1765) > The 120 Episode objects reference audio files under channel_dir, but no files are created… ✅ Fixed in commit `8e036f7` — each episode now writes a placeholder audio file, so `build_feed_xml` exercises the `stat()` size path (0 for empty files) instead of the `exists()` fallback.
marvin8 approved these changes 2026-08-20 04:14:43 +00:00
marvin8 manually merged commit 1e4d3da372 into main 2026-08-20 04:15:14 +00:00
marvin8 deleted branch feat/issue-29-edge-case-tests 2026-08-20 04:15:30 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
marvin8/sub2pod!36
No description provided.