"""Tests for marketing_intelligence.scraper.url_builder.""" from marketing_intelligence.scraper.url_builder import sound_url, tag_url, video_url class TestSoundUrl: def test_builds_correct_url(self): assert sound_url("7123456789") == "https://www.tiktok.com/music/-7123456789" def test_id_is_appended_with_dash(self): assert "/-" in sound_url("999") class TestVideoUrl: def test_builds_correct_url(self): assert video_url("joycrookesmusic", "7649525945887509782") == ( "https://www.tiktok.com/@joycrookesmusic/video/7649525945887509782" ) def test_at_sign_prefix(self): assert "/@" in video_url("artist", "123") class TestTagUrl: def test_builds_correct_url(self): assert ( tag_url("feetdontfailmenow") == "https://www.tiktok.com/tag/feetdontfailmenow" ) def test_strips_leading_hash(self): assert tag_url("#trending") == "https://www.tiktok.com/tag/trending" def test_strips_all_leading_hashes(self): # lstrip strips ALL leading # characters assert tag_url("##doubled") == "https://www.tiktok.com/tag/doubled"