Plays folders of videos on a loop from boot, with a controller menu, per-video on/off, play settings, a logo boot splash and a nightly YouTube sync. Tested on a Raspberry Pi 4; x86 paths are untested. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
21 lines
757 B
Python
21 lines
757 B
Python
import unittest
|
|
|
|
from sync_youtube import parse_sources
|
|
|
|
|
|
class ParseSourcesTest(unittest.TestCase):
|
|
def test_reads_folders_and_links(self):
|
|
text = "# comment\n\nBirds and Squirrels | https://y.be/a\nFish|https://y.be/b?x=1\n"
|
|
self.assertEqual(parse_sources(text), [("Birds and Squirrels", "https://y.be/a"),
|
|
("Fish", "https://y.be/b?x=1")])
|
|
|
|
def test_rejects_bad_lines(self):
|
|
for line in ("https://y.be/a", "| https://y.be/a", "Fish | not-a-link",
|
|
"../escape | https://y.be/a", ".. | https://y.be/a",
|
|
"a/b | https://y.be/a"):
|
|
self.assertEqual(parse_sources(line), [], line)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|