#!/usr/bin/python

"""
Test PelinkWorker

Run the video player skipping the GUI interaction to test:
- PelinkClient (websockets)
- PelinkPlayer (mpv)

Change TEST_MOVIE to a valid video.
"""

from pathlib import Path
import threading
import time

from PelinkWorker import PelinkWorker

TEST_MOVIE = Path.home() / "test.webm"

def main():
    worker = PelinkWorker(bus=None)
    thread = threading.Thread(target=worker.run, daemon=True)
    thread.start()

    time.sleep(0.2)
    worker.launch({"file_path": TEST_MOVIE, "club": "testclub"})

    thread.join()


if __name__ == "__main__":
    main()
