refactor(ui): delete legacy static website and refresh documentation
This commit is contained in:
@@ -53,11 +53,25 @@ class BackendContractTests(unittest.TestCase):
|
||||
self.assertFalse(response.json()["allowDirect"])
|
||||
self.assertNotIn("auth", response.json())
|
||||
paths = self.client.get("/openapi.json").json()["paths"]
|
||||
for path in ("/api/me", "/api/session/heartbeat", "/api/session/end"):
|
||||
for method, path in (
|
||||
("GET", "/api/me"), ("POST", "/api/session/heartbeat"), ("POST", "/api/session/end"),
|
||||
):
|
||||
self.assertNotIn(path, paths)
|
||||
self.assertEqual(self.client.request(method, path).status_code, 404)
|
||||
self.assertFalse(any(getattr(route, "path", "").startswith("/oauth") for route in server.app.routes))
|
||||
self.upstream.assert_not_called()
|
||||
|
||||
def test_only_documentation_is_served_as_static_content(self):
|
||||
for path in ("/", "/index.html", "/main.js", "/style.css", "/server.py", "/requirements.txt"):
|
||||
self.assertEqual(self.client.get(path).status_code, 404)
|
||||
self.assertEqual(self.client.get("/docs").status_code, 200)
|
||||
self.assertEqual(self.client.get("/docs/README.md").status_code, 200)
|
||||
for path in ("/project/", "/public/docs.html"):
|
||||
response = self.client.get(path, follow_redirects=False)
|
||||
self.assertEqual(response.status_code, 307)
|
||||
self.assertEqual(response.headers["location"], "/docs/proposals/vocero-architecture.html")
|
||||
self.upstream.assert_not_called()
|
||||
|
||||
def test_session_grant_passes_through_without_extra_fields_or_cookies(self):
|
||||
self.respond(httpx.Response(200, json=GRANT))
|
||||
response = self.client.post("/api/session", json={})
|
||||
|
||||
Reference in New Issue
Block a user