-
Notifications
You must be signed in to change notification settings - Fork 0
π§ͺ QA: Add test for SubtitleProcessor edge case #122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: staging
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -14,3 +14,29 @@ def test_clean_vtt_removes_metadata_and_timestamps(): | |||||||||
| """ | ||||||||||
| result = SubtitleProcessor.clean_vtt(vtt_content) | ||||||||||
| assert result == "Hello Hello world" | ||||||||||
|
|
||||||||||
| def test_format_as_markdown_edge_cases(): | ||||||||||
| text = "Sentence one. Sentence two! Sentence three? Sentence four." | ||||||||||
| metadata = { | ||||||||||
| "title": "Test Video", | ||||||||||
| "channel": "Test Channel", | ||||||||||
| "url": "https://example.com/video", | ||||||||||
| "date": "2023-01-01" | ||||||||||
| } | ||||||||||
|
|
||||||||||
| md = SubtitleProcessor.format_as_markdown(text, metadata) | ||||||||||
| assert "Test Video" in md | ||||||||||
| assert "Test Channel" in md | ||||||||||
| assert "https://example.com/video" in md | ||||||||||
| assert "2023-01-01" in md | ||||||||||
| assert "Sentence one. Sentence two! Sentence three? Sentence four." in md | ||||||||||
|
|
||||||||||
| def test_format_as_markdown_missing_metadata(): | ||||||||||
| text = "Just some text." | ||||||||||
| metadata = {} | ||||||||||
|
|
||||||||||
| md = SubtitleProcessor.format_as_markdown(text, metadata) | ||||||||||
| assert "Unknown Title" in md | ||||||||||
| assert "Unknown Channel" in md | ||||||||||
| assert "**Source:** \n" in md | ||||||||||
| assert "**Date:** \n" in md | ||||||||||
|
Comment on lines
+41
to
+42
|
||||||||||
| assert "**Source:** \n" in md | |
| assert "**Date:** \n" in md | |
| assert "**Source:**" in md | |
| assert "**Date:**" in md |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test appears to be the normal/happy-path case (metadata fully populated) rather than an edge case. Renaming it to something like
test_format_as_markdown_with_metadatawould make the intent clearer and help future readers quickly find true edge-case coverage.