Skip to content

Tests: Add 219 unit tests for server-side logic#755

Open
hex110 wants to merge 1 commit intoSyncplay:masterfrom
hex110:feature/add-tests
Open

Tests: Add 219 unit tests for server-side logic#755
hex110 wants to merge 1 commit intoSyncplay:masterfrom
hex110:feature/add-tests

Conversation

@hex110
Copy link

@hex110 hex110 commented Feb 15, 2026

Summary

Added 219 unit tests across 6 new files to cover the core server-side Syncplay logic.

I also added conftest.py to handle shared fixtures (mock Rooms, Watchers, and RoomManagers). No existing source files were modified; everything is contained within tests/.

Coverage Breakdown

Module Tests What's covered
test_utils.py 63 parseTime, formatTime, formatSize, isASCII, isURL, meetsMinVersion, filename hashing/sanitization, RoomPasswordProvider, RandomStringGenerator
test_room.py 36 Room/ControlledRoom creation, persistence, play state, position tracking, watcher lifecycle, playlist handling, loadRoom
test_room_manager.py 16 findFreeUsername, moveWatcher, removeWatcher, broadcast, and PublicRoomManager isolation
test_watcher.py 20 Position dead-reckoning, __lt__ comparison, ready state, isController, updateState, file truncation
test_protocols.py 22 handleMessages dispatch, hello extraction, playstate extraction, sendHello, _SetUser events, getFeatures, PingService
test_constants.py 27 Type/range sanity checks, getValueForOS, regex compilation, version string format

How to test

You will need pytest and the twisted TLS extras installed.

pip install pytest "twisted[tls]" pem certifi
pytest tests/ -v

  219 unit tests covering utils, Room, ControlledRoom, RoomManager,
  Watcher, protocol message handling, PingService, and constants.
  No existing files modified.

  Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant