fix(gtea): ruff format + check all gtea files and bridge.py
Clears cc-ci self-test lint failures: - ruff format: 9 files reformatted (all gtea test files + test_discovery.py) - ruff check --fix: bridge.py UP017 (datetime.UTC alias) + 6 gtea check errors - manifest.py B007: rename unused loop variable path → _path (no auto-fix available) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
d832b353e4
commit
2d865f06cb
@@ -33,8 +33,9 @@ def test_install_gitea(live_app, meta):
|
||||
# 3. Admin API reachable + authenticated — GET /api/v1/users/search as ci_admin
|
||||
user, password = admin_creds(live_app)
|
||||
import base64
|
||||
import urllib.request
|
||||
import ssl
|
||||
import urllib.request
|
||||
|
||||
ctx = ssl.create_default_context()
|
||||
ctx.check_hostname = False
|
||||
ctx.verify_mode = ssl.CERT_NONE
|
||||
@@ -44,6 +45,7 @@ def test_install_gitea(live_app, meta):
|
||||
headers={"Authorization": f"Basic {auth}"},
|
||||
)
|
||||
import urllib.error
|
||||
|
||||
try:
|
||||
with urllib.request.urlopen(req, timeout=15, context=ctx) as r:
|
||||
assert r.status == 200, f"Admin API /users/search returned {r.status}"
|
||||
@@ -52,16 +54,19 @@ def test_install_gitea(live_app, meta):
|
||||
|
||||
# 4. Playwright: sign-in page renders
|
||||
from playwright.sync_api import sync_playwright
|
||||
|
||||
url = f"https://{live_app}/user/login"
|
||||
with sync_playwright() as p:
|
||||
browser = p.chromium.launch(args=["--no-sandbox"])
|
||||
try:
|
||||
page = browser.new_context(ignore_https_errors=True).new_page()
|
||||
harness_browser.goto_with_retry(page, url, accept_statuses=(200, 302), goto_timeout_ms=30_000)
|
||||
harness_browser.goto_with_retry(
|
||||
page, url, accept_statuses=(200, 302), goto_timeout_ms=30_000
|
||||
)
|
||||
page.wait_for_selector("input#user_name", timeout=20_000)
|
||||
content = page.content()
|
||||
assert "gitea" in content.lower() or "sign in" in content.lower(), (
|
||||
"Sign-in page did not render expected gitea content"
|
||||
)
|
||||
assert (
|
||||
"gitea" in content.lower() or "sign in" in content.lower()
|
||||
), "Sign-in page did not render expected gitea content"
|
||||
finally:
|
||||
browser.close()
|
||||
|
||||
Reference in New Issue
Block a user