Add initial device mapping tests #57
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "test/issue-48-device-mapping-tests"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
tests/conftest.pywithmake_deviceandmake_zonemock factories built ontypes.SimpleNamespace. The validator usesgetattrto read OpenRGB SDK objects, so these mocks expose the same attribute surface (.name,.type,.zones,.leds_count) without needing the real SDK or any hardware.tests/test_device_mapping.pywith 17 tests covering the public API ofrgb_aura.device_mapping.Coverage
load_mapping_config— 7 testsschema_version.deviceskey.devicesis not a JSON object.validate_device_mapping— 8 testsLogicalZoneMapping.Edge cases — 2 tests
usable_led_indexesvalidates cleanly (reserved zone protection lives at the runtime layer, not in the validator).Verification
python -m pytest tests/— 18 passed (17 new + the existingtest_run_combined_runtime_returns_mapping_error_when_validation_failsregression test from #45).ruff format src tests scripts— 31 files left unchanged.ruff check src tests scripts— all checks passed.python -m rgb_aura.main --dry-run --dry-run-events 3— clean run, all 14 animations registered, scheduler preview produces events normally.Hardware verification
Not required. Tests run against mock OpenRGB device objects; no real SDK, no hardware, no LED write path touched.
Linked issue
Closes #48.
Branch workflow
developtest/issue-48-device-mapping-testsdevelopmain.Notes for future work
tests/conftest.pymock factories are reusable for upcoming test work, especially #49 (animation frame integrity tests). No duplication needed.