MCPcopy Create free account
hub / github.com/TheMariday/marimapper / test_basic_usage

Function test_basic_usage

test/test_backend.py:6–28  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4
5
6def test_basic_usage():
7
8 temp_backend_file = tempfile.NamedTemporaryFile(delete=False, suffix=".py")
9 temp_backend_file.write(
10 b"""
11class 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
31def test_invalid_backend_due_to_missing_function():

Callers

nothing calls this directly

Calls 4

load_custom_backendFunction · 0.90
writeMethod · 0.80
closeMethod · 0.80
get_led_countMethod · 0.45

Tested by

no test coverage detected