Address code review and CodeQL feedback: fix assertion logic and URL checks

Agent-Logs-Url: https://github.com/thaitien280401-stack/RedditVideoMakerBot/sessions/51e17be8-4f67-4153-a83b-fffef32969b3

Co-authored-by: thaitien280401-stack <271128961+thaitien280401-stack@users.noreply.github.com>
pull/2482/head^2
copilot-swe-agent[bot] 2 days ago committed by GitHub
parent ae4ed4a154
commit 18fd2b4aef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -196,7 +196,7 @@ class TestTikTokUploadIntegration:
url = uploader.upload(m)
assert url is not None
assert "tiktok.com" in url
assert url.startswith("https://www.tiktok.com/")
# ===================================================================
@ -254,4 +254,4 @@ class TestFacebookUploadIntegration:
url = uploader.upload(m)
assert url is not None
assert "facebook.com" in url
assert url.startswith("https://www.facebook.com/")

@ -67,5 +67,5 @@ class TestSaveData:
with patch("builtins.open", m):
save_data("test_channel", "output2.mp4", "Another Title", "thread_123", "gta")
# Should not write anything since ID exists
assert not m().write.called or m().seek.called is False
# Verify no new data was written (duplicate ID skipped)
assert not m().write.called

@ -43,12 +43,9 @@ class TestSanitizeText:
text = "1+1 equals 2"
result = sanitize_text(text)
# The + is replaced by "plus" via str.replace before regex strips it
# However, the regex removes standalone + first.
# The replacement text.replace("+", "plus") runs after regex.
# So "1+1" → regex removes "+" → "1 1" → replace doesn't find "+" → "1 1"
# But text.replace runs on the result, so let's check actual behavior.
# Verify numeric content is preserved after sanitization
assert "1" in result
assert "equals" in result
def test_removes_extra_whitespace(self):
from utils.voice import sanitize_text

Loading…
Cancel
Save