Files
wehub-resource-sync 1443d3fdf9
Ruff Format Check / Ruff Format & Lint (push) Failing after 7m39s
Deploy VitePress site to Pages / build (push) Failing after 9m11s
Deploy VitePress site to Pages / Deploy (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:32:26 +08:00

30 lines
1.1 KiB
Python

from __future__ import annotations
import pytest
pytestmark = [pytest.mark.asyncio, pytest.mark.integration]
USER_CONFIG_PATH = "/api/user/config"
async def test_user_config_requires_auth(test_client):
response = await test_client.get(USER_CONFIG_PATH)
assert response.status_code == 401
async def test_user_config_round_trip(test_client, standard_user):
headers = standard_user["headers"]
initial_response = await test_client.get(USER_CONFIG_PATH, headers=headers)
assert initial_response.status_code == 200, initial_response.text
initial_payload = initial_response.json()
assert initial_payload["enable_memory"] is False
save_response = await test_client.put(USER_CONFIG_PATH, json={"enable_memory": True}, headers=headers)
assert save_response.status_code == 200, save_response.text
assert save_response.json()["enable_memory"] is True
final_response = await test_client.get(USER_CONFIG_PATH, headers=headers)
assert final_response.status_code == 200, final_response.text
assert final_response.json()["enable_memory"] is True