тест 2
This commit is contained in:
@@ -89,7 +89,6 @@ def test_timer_fast_backend_uses_one_no_ack_batch_and_bypasses_mapping_lock(tmp_
|
||||
user,
|
||||
[
|
||||
{"Function": "StopCountdown", "Input": "SCORE", "SelectedName": "TIME.Text"},
|
||||
{"Function": "SetCountdown", "Input": "SCORE", "SelectedName": "TIME.Text", "Value": "00:18:41"},
|
||||
],
|
||||
delivery_mode="timer-fast",
|
||||
),
|
||||
@@ -97,16 +96,21 @@ def test_timer_fast_backend_uses_one_no_ack_batch_and_bypasses_mapping_lock(tmp_
|
||||
)
|
||||
|
||||
batches = [item for item in ws.sent if item.get("type") == "vmix.batch"]
|
||||
assert len(batches) == 2
|
||||
singles = [item for item in ws.sent if item.get("type") == "vmix.command"]
|
||||
assert len(batches) == 1
|
||||
assert [item["Function"] for item in batches[0]["commands"]] == ["SetCountdown", "StartCountdown"]
|
||||
assert [item["Function"] for item in batches[1]["commands"]] == ["StopCountdown", "SetCountdown"]
|
||||
assert not [item for item in ws.sent if item.get("type") == "vmix.command"]
|
||||
for payload in (result, stop_result):
|
||||
assert payload["ok"] is True
|
||||
assert payload["transport"] == "timer-batch-no-ack"
|
||||
assert payload["confirmation"] == "not_waited"
|
||||
assert payload["applied"] == 2
|
||||
assert all(row["ack_waited"] is False for row in payload["results"])
|
||||
assert len(singles) == 1
|
||||
assert singles[0]["command"]["Function"] == "StopCountdown"
|
||||
assert result["ok"] is True
|
||||
assert result["transport"] == "timer-batch-no-ack"
|
||||
assert result["confirmation"] == "not_waited"
|
||||
assert result["applied"] == 2
|
||||
assert all(row["ack_waited"] is False for row in result["results"])
|
||||
assert stop_result["ok"] is True
|
||||
assert stop_result["transport"] == "timer-no-ack"
|
||||
assert stop_result["confirmation"] == "not_waited"
|
||||
assert stop_result["applied"] == 1
|
||||
assert all(row["ack_waited"] is False for row in stop_result["results"])
|
||||
assert not hub._pending_commands
|
||||
|
||||
asyncio.run(scenario())
|
||||
|
||||
Reference in New Issue
Block a user