Spaces:
Sleeping
Sleeping
| import requests | |
| def test_generate_endpoint(): | |
| url = "http://127.0.0.1:8000/generate" | |
| payload = { | |
| "text": "Hello", | |
| "murf_api_key": "dummy_key", | |
| "voice_id": "en-US-marcus" | |
| } | |
| print("Testing /generate endpoint...") | |
| response = requests.post(url, json=payload) | |
| # We expect 400 because the key is dummy, but this proves the endpoint exists and calls Murf | |
| if response.status_code == 400: | |
| print("PASS: Endpoint exists and returned 400 as expected (Invalid Key).") | |
| print("Response:", response.json()) | |
| elif response.status_code == 200: | |
| print("FAIL: Unexpected Success with dummy key?") | |
| else: | |
| print(f"FAIL: Status {response.status_code}") | |
| print(response.text) | |
| if __name__ == "__main__": | |
| test_generate_endpoint() | |