C1a: code only, no comments, no Markdown
Remove 64 Python docstrings and 39 comments, and trim prose from three noqa pragmas. The submodule had zero tracked Markdown files. Move published route descriptions into decorator arguments and the Correction schema description into ConfigDict. Drop internal docstrings, including the OAuth callback excluded from OpenAPI. Published route descriptions are unchanged in the before-and-after comparison of the nine application routers. The full application OpenAPI check requires fastapi-users, which is missing from the shared environment.
This commit is contained in:
+3
-7
@@ -1,6 +1,3 @@
|
||||
"""Sign-in for the web app: an administrator from the environment, users who see some
|
||||
domains, a session cookie, and an API that answers everyone as before."""
|
||||
|
||||
import pytest
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
@@ -32,11 +29,10 @@ def test_the_first_administrator_signs_in_and_adds_a_team(client):
|
||||
assert login(client, "cacu@isssteleon.mx", "equipo-cacu").status_code == 204
|
||||
assert client.get("/users/me").json()["domains"] == ["cacu"]
|
||||
other = {"email": "x@isssteleon.mx", "password": "otra-clave"}
|
||||
assert client.post("/users/register", json=other).status_code == 403 # not an admin
|
||||
assert client.post("/users/register", json=other).status_code == 403
|
||||
|
||||
|
||||
def test_the_api_answers_without_a_session(client):
|
||||
# routes that read no platform data (the in-process app's database is the default one)
|
||||
for path in ("/health", "/domains", "/ingest/schema", "/ingest/sources/types"):
|
||||
assert client.get(path).status_code == 200, path
|
||||
|
||||
@@ -44,7 +40,7 @@ def test_the_api_answers_without_a_session(client):
|
||||
def test_a_restart_keeps_the_administrator_once_and_the_session_secret(client, own_platform):
|
||||
assert login(client, "admin@isssteleon.mx", "una-clave-larga").status_code == 204
|
||||
secret = (own_platform / "auth_secret").read_text()
|
||||
with TestClient(app): # the app starts again on the same data
|
||||
with TestClient(app):
|
||||
pass
|
||||
assert (own_platform / "auth_secret").read_text() == secret
|
||||
assert client.get("/users/me").status_code == 200 # the session still holds
|
||||
assert client.get("/users/me").status_code == 200
|
||||
|
||||
Reference in New Issue
Block a user