MCPcopy
hub / github.com/microsoft/Magma / main

Function main

server/test_api.py:110–124  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

108 return False
109
110def main():
111 parser = argparse.ArgumentParser(description="Test the Magma API service")
112 parser.add_argument("--url", default="http://localhost:8080", help="Base URL of the API")
113 parser.add_argument("--image", help="Path to an image file for testing prediction")
114 parser.add_argument("--wait", action="store_true", help="Wait for service to be available")
115 args = parser.parse_args()
116
117 if args.wait:
118 if not wait_for_service(args.url):
119 sys.exit(1)
120
121 if test_health(args.url):
122 test_prediction(args.url, args.image)
123 else:
124 sys.exit(1)
125
126if __name__ == "__main__":
127 main()

Callers 1

test_api.pyFile · 0.70

Calls 3

wait_for_serviceFunction · 0.85
test_healthFunction · 0.85
test_predictionFunction · 0.85

Tested by

no test coverage detected