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:
@ -21,10 +21,10 @@ import urllib.request
|
||||
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..", "..", "runner"))
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
|
||||
from ops import admin_creds # noqa: E402
|
||||
|
||||
import ssl
|
||||
|
||||
from ops import admin_creds # noqa: E402
|
||||
|
||||
_CTX = ssl.create_default_context()
|
||||
_CTX.check_hostname = False
|
||||
_CTX.verify_mode = ssl.CERT_NONE
|
||||
@ -72,9 +72,12 @@ def test_git_push(live_app):
|
||||
|
||||
# 1. Create test repo (auto_init adds an initial commit so the branch exists)
|
||||
status, body = _api(
|
||||
live_app, "/user/repos", method="POST",
|
||||
live_app,
|
||||
"/user/repos",
|
||||
method="POST",
|
||||
body={"name": repo_name, "private": False, "auto_init": True, "default_branch": "main"},
|
||||
user=user, password=password,
|
||||
user=user,
|
||||
password=password,
|
||||
)
|
||||
assert status == 201, f"repo create HTTP {status}: {body}"
|
||||
# Embed credentials directly in the URL (password is 32-char hex, URL-safe).
|
||||
@ -107,14 +110,14 @@ def test_git_push(live_app):
|
||||
|
||||
# 5. Verify commit landed via API
|
||||
status, commits = _api(
|
||||
live_app, f"/repos/{user}/{repo_name}/commits?limit=1",
|
||||
user=user, password=password,
|
||||
live_app,
|
||||
f"/repos/{user}/{repo_name}/commits?limit=1",
|
||||
user=user,
|
||||
password=password,
|
||||
)
|
||||
assert status == 200 and commits, f"commit list HTTP {status}: {commits}"
|
||||
commit_msg = commits[0].get("commit", {}).get("message", "").strip()
|
||||
assert "automated push test" in commit_msg, (
|
||||
f"Unexpected commit message: {commit_msg!r}"
|
||||
)
|
||||
assert "automated push test" in commit_msg, f"Unexpected commit message: {commit_msg!r}"
|
||||
finally:
|
||||
shutil.rmtree(tmpdir, ignore_errors=True) # removes parent + repo subdir
|
||||
# 6. Cleanup — delete the test repo
|
||||
|
||||
Reference in New Issue
Block a user