Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gabalafou committed Nov 13, 2024
1 parent 3bae0cf commit 3745e2c
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ def test_unknown_routes(self, testclient):
"""Rather than return a 404, the server should return the client app
and let it handle unknown routes
"""
response = testclient.get(self.full_route("/foo"))
response = testclient.get(self.full_route("/ui/foo"))
assert_client_app(response)

response = testclient.get(self.full_route("/foo/bar"))
response = testclient.get(self.full_route("/ui/foo/bar"))
assert_client_app(response)

def test_not_found_route(self, testclient):
"""The /not-found route should also return the client app
but with a 404 status code
"""
response = testclient.get(self.full_route("/not-found"))
response = testclient.get(self.full_route("/ui/not-found"))
assert response.status_code == 404
assert "text/html" in response.headers["content-type"]
assert "condaStoreConfig" in response.text
Expand All @@ -58,7 +58,6 @@ def test_route_outside_ui_app(self, testclient):
"""The server should not return the client app for a server-side
route
"""
# Trailing slash needed on next line. Is this a problem?
response = testclient.get(self.full_route("/admin/"))
assert response.is_success
assert "condaStoreConfig" not in response.text
Expand All @@ -80,7 +79,7 @@ def test_unknown_route_outside_prefix(self, testclient):
"""The server should return a 404 for an unknown route outside
the url prefix and should not return the client app
"""
response = testclient.get("/foo/bar")
response = testclient.get("/ui/foo/bar")
assert_not_found_not_client_app(response)


Expand All @@ -95,7 +94,7 @@ def test_ui_disabled(conda_store_server):
response = testclient.get("/")
assert_not_found_not_client_app(response)

response = testclient.get("/not-found")
response = testclient.get("/ui/not-found")
assert_not_found_not_client_app(response)

response = testclient.get("/admin/")
Expand Down

0 comments on commit 3745e2c

Please sign in to comment.