Buckets:
| import json | |
| import os | |
| import asyncio | |
| from server import load_openapi_spec, list_spec_endpoints | |
| async def test_spec_logic(): | |
| print("Testing Spec Loading...") | |
| # Mocking a spec load since I don't want to rely on external URL in unit test | |
| spec_name = "test_api" | |
| os.makedirs("specs", exist_ok=True) | |
| mock_spec = { | |
| "openapi": "3.0.0", | |
| "paths": { | |
| "/users": {"get": {}}, | |
| "/posts": {"post": {}} | |
| } | |
| } | |
| with open(f"specs/{spec_name}.json", "w") as f: | |
| json.dump(mock_spec, f) | |
| endpoints = list_spec_endpoints(spec_name) | |
| print(f"Endpoints: {endpoints}") | |
| assert "GET /users" in endpoints | |
| assert "POST /posts" in endpoints | |
| print("PASSED") | |
| if __name__ == "__main__": | |
| asyncio.run(test_spec_logic()) | |
Xet Storage Details
- Size:
- 793 Bytes
- Xet hash:
- 6060397693979c934dca1c6039d9a52dba4358e259d5597609b557ccd1318ef6
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.