MCPcopy Create free account
hub / github.com/FastLED/FastLED / parse_csv_result

Function parse_csv_result

ci/autoresearch/test_lpc_ws2812_loopback.py:111–133  ·  view source on GitHub ↗

Parse the AutoResearchLpc ws2812SctTest CSV reply. Format (must match the sketch handler): success,test_case,num_leds,exp_bytes,dec_bytes,matched,mismatched,edges

(csv: str)

Source from the content-addressed store, hash-verified

109
110
111def parse_csv_result(csv: str) -> dict[str, int]:
112 """Parse the AutoResearchLpc ws2812SctTest CSV reply.
113
114 Format (must match the sketch handler):
115 success,test_case,num_leds,exp_bytes,dec_bytes,matched,mismatched,edges
116 """
117 fields = (
118 "success",
119 "test_case",
120 "num_leds",
121 "exp_bytes",
122 "dec_bytes",
123 "matched",
124 "mismatched",
125 "edges",
126 )
127 parts = csv.split(",")
128 if len(parts) != len(fields):
129 return {}
130 try:
131 return {k: int(v) for k, v in zip(fields, parts)}
132 except ValueError:
133 return {}
134
135
136def evaluate(case: TestCase, parsed: dict[str, int]) -> tuple[bool, str]:

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected