Commit Graph
2 Commits
Author SHA1 Message Date
logan 47f077c97f test: instance端点扩展测试 (8→17) + 数据库列补齐修复
测试扩展 (test_instances.py):
- list_instances: 新增过滤(db_type/env)、权限(non_admin)、未认证场景
- update_instance: 新增404、developer禁止、dba允许
- delete_instance: 新增404、developer禁止

数据库修复:
- audit_rules表补齐value列
- audit_logs表补齐11列(username/db_type/database_name等)
- instances表补齐5列(access_mode/workflow/excluded_databases等)

依赖修复: bcrypt 4.0.1 兼容 passlib 1.7.4
2026-05-23 23:10:19 +08:00
loganandClaude Opus 4.7 c0c731acfc feat: TDD Phase 1 — 44 backend API tests passing
Test infrastructure:
- conftest.py with SQLite in-memory DB, isolated per-test cleanup
- pytest.ini with asyncio auto mode
- Fixtures: admin/dba/developer/guest/disabled users, tokens, test instance

Test coverage (44 tests):
- test_auth: login/logout/me/token expiry (8 tests)
- test_users: CRUD + role permissions (8 tests)
- test_instances: CRUD + connection test mock (8 tests)
- test_tickets: CRUD + review/execute workflow + pagination (11 tests)
- test_query: select/drop/delete rejection + guest deny (4 tests)
- test_dashboard: stats + auth check (2 tests)

Backend fix:
- query endpoint now catches ValueError from QueryService → 400 instead of 500

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 11:34:47 +08:00