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

Function main

ci/rpc_schema_validator.py:203–241  ·  view source on GitHub ↗

Test schema validator

()

Source from the content-addressed store, hash-verified

201
202
203def main():
204 """Test schema validator"""
205 import sys
206
207 if len(sys.argv) < 2:
208 print("Usage: python rpc_schema_validator.py <port>")
209 sys.exit(1)
210
211 port = sys.argv[1]
212
213 try:
214 validator = RpcSchemaValidator(port)
215
216 print("\n📋 Available methods:")
217 for method in validator.list_methods():
218 info = validator.get_method_schema(method)
219 params = ", ".join(f"{p.name}:{p.type}" for p in info.params)
220 print(f" - {method}({params}) -> {info.returnType}")
221
222 print("\n✅ Schema validator ready")
223
224 # Example validation
225 print("\n🧪 Testing validation:")
226 try:
227 validator.validate_request(
228 "runSingleTest",
229 {"driver": "PARLIO", "laneSizes": [10], "iterations": 1},
230 )
231 print(" ✅ Valid request")
232 except ValidationError as e:
233 print(f" ❌ Invalid request: {e}")
234
235 except KeyboardInterrupt as ki:
236 handle_keyboard_interrupt(ki)
237 print("\n⚠️ Interrupted by user")
238 sys.exit(130)
239 except Exception as e:
240 print(f"❌ Error: {e}")
241 sys.exit(1)
242
243
244if __name__ == "__main__":

Callers 1

Calls 6

list_methodsMethod · 0.95
get_method_schemaMethod · 0.95
validate_requestMethod · 0.95
RpcSchemaValidatorClass · 0.85
printFunction · 0.50

Tested by

no test coverage detected