Assistant: codex Assistant-Model: gpt-5.6-sol Assistant-Session: 01a03397-4d51-7fd1-8ff2-946eb22ea2bc
This commit is contained in:
parent
408d32df88
commit
74b2f27997
20 changed files with 608 additions and 182 deletions
|
|
@ -1,6 +1,24 @@
|
|||
from tamq.cli import parse_size
|
||||
from tamq.cli import ensure_manual_service, parse_size
|
||||
|
||||
|
||||
def test_parse_size():
|
||||
assert parse_size("100MB") == 100_000_000
|
||||
assert parse_size("2KB") == 2_000
|
||||
|
||||
|
||||
def test_manual_service_restarts_legacy_broker(monkeypatch):
|
||||
capabilities = iter([[], ["manual_delivery"]])
|
||||
starts = []
|
||||
stops = []
|
||||
|
||||
async def request(payload):
|
||||
assert payload == {"op": "ping"}
|
||||
return {"ok": True, "capabilities": next(capabilities)}
|
||||
|
||||
monkeypatch.setattr("tamq.cli.ensure_service", lambda: starts.append(True) or True)
|
||||
monkeypatch.setattr("tamq.cli.stop_service_process", lambda: stops.append(True) or 42)
|
||||
monkeypatch.setattr("tamq.cli.request", request)
|
||||
|
||||
assert ensure_manual_service() is True
|
||||
assert len(starts) == 2
|
||||
assert stops == [True]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue