-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change documents parameter to Sequence[Dict[str, Any]], add simple /o…
…penapi.json and /docs resource is there test
- Loading branch information
Showing
2 changed files
with
21 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from fastapi.testclient import TestClient | ||
from marqo.tensor_search.api import app | ||
from tests.marqo_test import MarqoTestCase | ||
|
||
|
||
class OpenApiTests(MarqoTestCase): | ||
def setUp(self): | ||
self.client = TestClient(app) | ||
|
||
def test_docs_endpoint(self): | ||
"""Test if the /docs endpoint is accessible and returns status code 200.""" | ||
response = self.client.get("/docs") | ||
self.assertEqual(response.status_code, 200, "The /docs endpoint should be accessible.") | ||
|
||
def test_openapi_json_endpoint(self): | ||
"""Test if the /openapi.json endpoint is accessible and returns status code 200.""" | ||
response = self.client.get("/openapi.json") | ||
self.assertEqual(response.status_code, 200, "The /openapi.json endpoint should be accessible.") |