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

Function test_partially_valid_data

test/test_2d_map.py:7–28  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5
6
7def test_partially_valid_data():
8 temp_led_map_file = tempfile.NamedTemporaryFile(delete=False, suffix=".csv")
9 temp_led_map_file.write(
10 b"""index,u,v
110,0.379490,0.407710
122,0,0
132.2,0,0
14bananas,apples,grapes
15"""
16 )
17 temp_led_map_file.close()
18
19 led_map = load_detections(Path(temp_led_map_file.name), 0)
20
21 assert led_map is not None
22
23 assert len(led_map) == 2
24
25 assert get_led(led_map, 0).point.position[0] == 0.379490
26 assert get_led(led_map, 0).point.position[1] == 0.407710
27 assert get_led(led_map, 2).point.position[0] == 0
28 assert get_led(led_map, 2).point.position[1] == 0
29
30
31def test_missing_headers():

Callers

nothing calls this directly

Calls 4

load_detectionsFunction · 0.90
get_ledFunction · 0.90
writeMethod · 0.80
closeMethod · 0.80

Tested by

no test coverage detected