Commit 56aecea0 authored by Luna's avatar Luna 😻

datadump: fix get_dump_status db calls

 - test_profile: add sanity test for profile.dump_status
parent a16ca536
Pipeline #47741325 passed with stage
in 2 minutes and 20 seconds
......@@ -86,14 +86,15 @@ async def request_data_dump(request):
async def get_dump_status(db, user_id: int):
row = await"""
"""Get datadump status."""
row = await db.fetchrow("""
SELECT user_id, start_timestamp, current_id, total_files, files_done
FROM current_dump_state
WHERE user_id = $1
""", user_id)
if not row:
queue = await"""
queue = await db.fetch("""
SELECT user_id
FROM dump_queue
ORDER BY request_timestamp ASC
......@@ -34,6 +34,10 @@ async def test_profile_work(test_cli):
# test_stats already checks data
assert isinstance(rjson['stats'], dict)
dstatus = rjson['dump_status']
assert isinstance(dstatus, dict)
assert isinstance(dstatus['state'], str)
async def test_limits_work(test_cli):
utoken = await login_normal(test_cli)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment