This is an automated email from the ASF dual-hosted git repository.

sbp pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git


The following commit(s) were added to refs/heads/main by this push:
     new 086c559  Move the test route to a test module
086c559 is described below

commit 086c55978f563b48cd5b839197e3a281a9ad811f
Author: Sean B. Palmer <[email protected]>
AuthorDate: Tue Nov 4 15:45:34 2025 +0000

    Move the test route to a test module
---
 atr/get/__init__.py |  2 ++
 atr/get/root.py     | 21 ---------------------
 atr/get/test.py     | 44 ++++++++++++++++++++++++++++++++++++++++++++
 playwright/test.py  |  2 +-
 4 files changed, 47 insertions(+), 22 deletions(-)

diff --git a/atr/get/__init__.py b/atr/get/__init__.py
index dd91e3b..95baae7 100644
--- a/atr/get/__init__.py
+++ b/atr/get/__init__.py
@@ -42,6 +42,7 @@ import atr.get.revisions as revisions
 import atr.get.root as root
 import atr.get.sbom as sbom
 import atr.get.start as start
+import atr.get.test as test
 import atr.get.tokens as tokens
 import atr.get.upload as upload
 import atr.get.user as user
@@ -74,6 +75,7 @@ __all__ = [
     "root",
     "sbom",
     "start",
+    "test",
     "tokens",
     "upload",
     "user",
diff --git a/atr/get/root.py b/atr/get/root.py
index 0fa35c2..299026b 100644
--- a/atr/get/root.py
+++ b/atr/get/root.py
@@ -19,7 +19,6 @@ import pathlib
 from typing import Final
 
 import aiofiles
-import asfquart.base as base
 import asfquart.session
 import quart.wrappers.response as quart_response
 import sqlalchemy.orm as orm
@@ -153,26 +152,6 @@ async def policies(session: web.Committer | None) -> str:
     return await template.blank("Policies", content=_POLICIES)
 
 
[email protected]("/test-login")
-async def test_login(session: web.Committer | None) -> web.WerkzeugResponse:
-    if not config.get().ALLOW_TESTS:
-        raise base.ASFQuartException("Test login not enabled", errorcode=404)
-
-    session_data = {
-        "uid": "test",
-        "fullname": "Test User",
-        "committees": ["test"],
-        "projects": ["test"],
-        "isMember": False,
-        "isChair": False,
-        "isRole": False,
-        "metadata": {},
-    }
-
-    asfquart.session.write(session_data)
-    return await web.redirect(index)
-
-
 @get.committer("/tutorial")
 async def tutorial(session: web.Committer) -> str:
     """Tutorial page."""
diff --git a/atr/get/test.py b/atr/get/test.py
new file mode 100644
index 0000000..e74454a
--- /dev/null
+++ b/atr/get/test.py
@@ -0,0 +1,44 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import asfquart.base as base
+import asfquart.session
+
+import atr.blueprints.get as get
+import atr.config as config
+import atr.get.root as root
+import atr.web as web
+
+
[email protected]("/test/login")
+async def test_login(session: web.Committer | None) -> web.WerkzeugResponse:
+    if not config.get().ALLOW_TESTS:
+        raise base.ASFQuartException("Test login not enabled", errorcode=404)
+
+    session_data = {
+        "uid": "test",
+        "fullname": "Test User",
+        "committees": ["test"],
+        "projects": ["test"],
+        "isMember": False,
+        "isChair": False,
+        "isRole": False,
+        "metadata": {},
+    }
+
+    asfquart.session.write(session_data)
+    return await web.redirect(root.index)
diff --git a/playwright/test.py b/playwright/test.py
index 937ca1a..e8b3334 100755
--- a/playwright/test.py
+++ b/playwright/test.py
@@ -862,7 +862,7 @@ def test_login(page: sync_api.Page, credentials: 
Credentials) -> None:
         remove_debugging = test_logging_debug(page, credentials)
 
     if credentials.username == "test":
-        go_to_path(page, "/test-login", wait=False)
+        go_to_path(page, "/test/login", wait=False)
         wait_for_path(page, "/")
         logging.info("Test login completed successfully")
         return


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to