()
| 108 | return False |
| 109 | |
| 110 | def 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 | |
| 126 | if __name__ == "__main__": |
| 127 | main() |
no test coverage detected