53863559f4
Retarget git remote, install path, and deploy docs from crypto_monitor to crypto_monitor_user. Co-authored-by: Cursor <cursoragent@cursor.com>
21 lines
546 B
Python
21 lines
546 B
Python
"""instance_live_push_lib 单元测试."""
|
|
from __future__ import annotations
|
|
|
|
import json
|
|
|
|
from lib.instance.instance_live_push_lib import InstanceLivePush
|
|
|
|
|
|
def test_tick_increments_version_and_connect_event() -> None:
|
|
push = InstanceLivePush()
|
|
v1 = push.tick("test")
|
|
v2 = push.tick("test")
|
|
assert v1 == 1
|
|
assert v2 == 2
|
|
gen = push.iter_sse()
|
|
first = next(gen)
|
|
assert first.startswith("event: live")
|
|
data = json.loads(first.split("data: ", 1)[1].strip())
|
|
assert data["live_version"] == 2
|
|
push.stop()
|