mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2026-10-28 00:12:04 +00:00
- Moved `client` and `dummy_nostr_client` fixtures to `src/tests/conftest.py` to fix F811 redefinition errors and improve test organization. - Introduced `make_dummy_nostr_client` factory fixture to support tests requiring multiple client instances. - Updated all affected tests to use the new fixture pattern. - Removed deprecated `is_flag=True` from Typer boolean options in CLI modules. - Fixed F541 (f-string without placeholders) in `entry_management.py`. - Fixed F841 (unused variable) in `manager.py`. Co-authored-by: PR0M3TH3AN <[email protected]>
14 lines
376 B
Python
14 lines
376 B
Python
import pytest
|
|
|
|
|
|
@pytest.mark.anyio
|
|
async def test_profile_stats_endpoint(client):
|
|
cl, token = client
|
|
stats = {"total_entries": 1}
|
|
import seedpass.api as api
|
|
|
|
api.app.state.pm.get_profile_stats = lambda: stats
|
|
res = await cl.get("/api/v1/stats", headers={"Authorization": f"Bearer {token}"})
|
|
assert res.status_code == 200
|
|
assert res.json() == stats
|