Render markdown in gist and project sidebar titles; add content visibility and GIF picker
DevPlace CI / test (push) Failing after 1h5m29s
DevPlace CI / test (push) Failing after 1h5m29s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
# retoor <retoor@molodetz.nl>
|
||||
|
||||
import asyncio
|
||||
|
||||
from tests.conftest import run_async
|
||||
|
||||
from devplacepy.services.dbapi.progress import hub
|
||||
from devplacepy.services.dbapi.service import DbApiJobService
|
||||
|
||||
|
||||
@@ -30,3 +33,23 @@ def test_process_rejects_non_select(local_db):
|
||||
finally:
|
||||
svc.cleanup(job)
|
||||
assert raised
|
||||
|
||||
|
||||
def test_stream_publishes_progress_to_subscriber(local_db):
|
||||
svc = DbApiJobService()
|
||||
uid = "unit-dbquery-progress"
|
||||
queue = hub.subscribe(uid)
|
||||
try:
|
||||
rows, truncated = run_async(svc._stream(uid, "SELECT 1 AS n", 5000))
|
||||
assert rows == [{"n": 1}]
|
||||
assert truncated is False
|
||||
frames = []
|
||||
while True:
|
||||
try:
|
||||
frames.append(queue.get_nowait())
|
||||
except asyncio.QueueEmpty:
|
||||
break
|
||||
assert any(frame.get("type") == "progress" for frame in frames)
|
||||
finally:
|
||||
hub.unsubscribe(uid, queue)
|
||||
hub.clear(uid)
|
||||
|
||||
Reference in New Issue
Block a user