Some checks failed
tamq-ci / test (push) Failing after 6s
Assistant: codex Assistant-Model: gpt-5.6-sol Assistant-Session: 01a03397-4d51-7fd1-8ff2-946eb22ea2bc
21 lines
883 B
Python
21 lines
883 B
Python
from tamq.broker import BrokerIdentity, InputBroker
|
|
from tamq.store import Store
|
|
|
|
|
|
def test_broker_preserves_identity(tmp_path):
|
|
store = Store(tmp_path / "queue.sqlite3")
|
|
broker = InputBroker(store, BrokerIdentity("tmux-amq-42", "net-kingdom"))
|
|
assert broker.inspect_line("@railiance-platform: hello") is not None
|
|
row = store.list()[0]
|
|
assert row["sender_repo"] == "net-kingdom"
|
|
assert row["endpoint_id"] == "tmux-amq-42"
|
|
|
|
|
|
def test_broker_accepts_hash_address_alias(tmp_path):
|
|
store = Store(tmp_path / "queue.sqlite3")
|
|
broker = InputBroker(store, BrokerIdentity("tmux-amq-42-boot", "net-kingdom"))
|
|
assert broker.inspect_line("#railiance-platform: hello") is not None
|
|
row = store.list()[0]
|
|
assert row["sender_repo"] == "net-kingdom"
|
|
assert row["target_repo"] == "railiance-platform"
|
|
assert row["endpoint_id"] == "tmux-amq-42-boot"
|