()
| 4 | |
| 5 | |
| 6 | def test_basic_usage(): |
| 7 | |
| 8 | temp_backend_file = tempfile.NamedTemporaryFile(delete=False, suffix=".py") |
| 9 | temp_backend_file.write( |
| 10 | b""" |
| 11 | class Backend: |
| 12 | |
| 13 | def __init__(self): |
| 14 | pass |
| 15 | |
| 16 | def get_led_count(self): |
| 17 | return 1 |
| 18 | |
| 19 | def set_led(self, led_index, on): |
| 20 | pass |
| 21 | """ |
| 22 | ) |
| 23 | from marimapper.backends.custom.custom_backend import load_custom_backend |
| 24 | |
| 25 | temp_backend_file.close() |
| 26 | backend = load_custom_backend(Path(temp_backend_file.name)) |
| 27 | |
| 28 | assert backend.get_led_count() == 1 |
| 29 | |
| 30 | |
| 31 | def test_invalid_backend_due_to_missing_function(): |
nothing calls this directly
no test coverage detected