Test: Refactor test fixtures to use HttpApiAuth naming consistently (#8180)

### What problem does this PR solve?

- Rename `api_key` fixture to `HttpApiAuth` across all test files
- Update all dependent fixtures and test cases to use new naming
- Maintain same functionality while improving naming clarity

The rename better reflects the fixture's purpose as an HTTP API
authentication helper rather than just an API key.

### Type of change

- [x] Refactoring
This commit is contained in:
Liu An
2025-06-11 14:25:40 +08:00
committed by GitHub
parent f29d9fa3f9
commit 6aff3e052a
30 changed files with 756 additions and 756 deletions

View File

@ -18,24 +18,24 @@ from common import batch_add_sessions_with_chat_assistant, delete_session_with_c
@pytest.fixture(scope="class")
def add_sessions_with_chat_assistant(request, api_key, add_chat_assistants):
def add_sessions_with_chat_assistant(request, HttpApiAuth, add_chat_assistants):
def cleanup():
for chat_assistant_id in chat_assistant_ids:
delete_session_with_chat_assistants(api_key, chat_assistant_id)
delete_session_with_chat_assistants(HttpApiAuth, chat_assistant_id)
request.addfinalizer(cleanup)
_, _, chat_assistant_ids = add_chat_assistants
return chat_assistant_ids[0], batch_add_sessions_with_chat_assistant(api_key, chat_assistant_ids[0], 5)
return chat_assistant_ids[0], batch_add_sessions_with_chat_assistant(HttpApiAuth, chat_assistant_ids[0], 5)
@pytest.fixture(scope="function")
def add_sessions_with_chat_assistant_func(request, api_key, add_chat_assistants):
def add_sessions_with_chat_assistant_func(request, HttpApiAuth, add_chat_assistants):
def cleanup():
for chat_assistant_id in chat_assistant_ids:
delete_session_with_chat_assistants(api_key, chat_assistant_id)
delete_session_with_chat_assistants(HttpApiAuth, chat_assistant_id)
request.addfinalizer(cleanup)
_, _, chat_assistant_ids = add_chat_assistants
return chat_assistant_ids[0], batch_add_sessions_with_chat_assistant(api_key, chat_assistant_ids[0], 5)
return chat_assistant_ids[0], batch_add_sessions_with_chat_assistant(HttpApiAuth, chat_assistant_ids[0], 5)