mirror of
https://github.com/Glitchy-Sheep/boosty-downloader.git
synced 2026-10-14 21:33:23 +00:00
[PR #155] [MERGED] [tests] Add golden tests for post mapper and HTML renderer #157
Labels
No labels
api-drift
bug
ci
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Glitchy-Sheep/boosty-downloader#157
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Glitchy-Sheep/boosty-downloader/pull/155
Author: @Glitchy-Sheep
Created: 8/16/2026
Status: ✅ Merged
Merged: 8/16/2026
Merged by: @Glitchy-Sheep
Base:
main← Head:test/golden-fixtures📝 Commits (1)
f8e95abtest: Add golden tests for post mapper and HTML renderer📊 Changes
5 files changed (+1058 additions, -2 deletions)
View changed files
➕
test/fixtures/rendered_post.html(+592 -0)➕
test/fixtures/single_post.json(+275 -0)➕
test/fixtures/single_post_domain.json(+99 -0)📝
test/unit/html_generator/html_templates_test.py(+34 -2)➕
test/unit/mappers/post_mapper_golden_test.py(+58 -0)📄 Description
[tests] Add golden tests for post mapper and HTML renderer
Summary
Third PR of the test safety-net stage (stacked on #154, merge order: #153 -> #154 -> this). Golden files pin the two transformations the upcoming refactoring touches hardest: DTO-to-domain mapping and HTML rendering. From now on neither can change a field or a byte unnoticed - the test goes red and the golden diff shows up in review.
What is in here
test/fixtures/single_post.json- a captured real API response of one post, sanitized: all ids, urls and texts replaced with fakes, zero real identifiers (checked). The real emptiness pattern ofplayerUrlsis preserved: progressive mp4 + dash/hls set, ondemand/live/hd empty. Extended with an audio chunk and an unknown-type chunktest/fixtures/single_post_domain.json- the pinned mapping result: 11 DTO chunks -> 10 domain chunks + unknown content recorded with its exact path (data[10].type)test/fixtures/rendered_post.html- the pinned byte-for-byte render of a fixed chunk showcase_showcase_chunks()helper (fresh list per call - the renderer mutates video/audio urls in place) and now covers file and audio chunks tooUPDATE_GOLDEN=1 task testregenerates both goldens for intentional changes - the golden diff is then reviewed like any code.The goldens already document three audit findings
signed_queryappended (files do) - a 403 risk on protected contentrelease <v2> & notes.zipraw)type="video/mp4"The upcoming render-fix PR will change these lines - visibly, as golden diffs.
Verification
task cigreen: lint, format, pyright, 149 passed + 1 xfailed, buildNotes
ci/skip-changelog)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.