test: format test suite

This commit is contained in:
huanghuoguoguo
2026-06-16 11:13:05 +08:00
parent 1ae5aacc00
commit ff0c5a6f0a
92 changed files with 1658 additions and 1713 deletions
+9 -4
View File
@@ -44,6 +44,7 @@ class TestStartupFlow:
# Database should have some tables after migration
import sqlite3
conn = sqlite3.connect(str(e2e_db_path))
cursor = conn.cursor()
@@ -74,10 +75,13 @@ class TestStartupFlow:
def test_auth_endpoint(self, e2e_client, e2e_tmpdir):
"""Test auth endpoint."""
# First startup may allow initial setup
response = e2e_client.post('/api/v1/user/auth', json={
'user': 'admin',
'password': 'admin',
})
response = e2e_client.post(
'/api/v1/user/auth',
json={
'user': 'admin',
'password': 'admin',
},
)
# Response could be:
# - 200 if auth succeeds
@@ -97,6 +101,7 @@ class TestStartupStages:
def test_migrations_applied(self, langbot_process, e2e_db_path):
"""Verify database migrations were applied."""
import sqlite3
conn = sqlite3.connect(str(e2e_db_path))
cursor = conn.cursor()
+1 -1
View File
@@ -176,4 +176,4 @@ def create_test_directories(tmpdir: Path) -> dict[str, Path]:
for path in directories.values():
path.mkdir(parents=True, exist_ok=True)
return directories
return directories
+4 -2
View File
@@ -90,9 +90,11 @@ precision = 2
f.write(coveragerc_content)
cmd = [
'coverage', 'run',
'coverage',
'run',
'--rcfile=' + str(coveragerc_path),
'-m', 'langbot',
'-m',
'langbot',
]
else:
cmd = ['uv', 'run', 'python', '-m', 'langbot']