feat: add experimental pushy delivery mode
Some checks failed
tamq-ci / test (push) Has been cancelled
Some checks failed
tamq-ci / test (push) Has been cancelled
Assistant: codex Assistant-Model: gpt-5.6-sol Assistant-Session: 01a03397-4d51-7fd1-8ff2-946eb22ea2bc
This commit is contained in:
parent
8186550c9a
commit
9ed8b62b45
16 changed files with 441 additions and 31 deletions
|
|
@ -1,5 +1,7 @@
|
|||
from tamq import control
|
||||
from tamq.control import ControlModeClient, shell_quote
|
||||
import pytest
|
||||
|
||||
from tamq.control import ControlModeClient, ControlModeError, shell_quote
|
||||
from tamq.tmux import shell_join
|
||||
|
||||
|
||||
|
|
@ -27,3 +29,39 @@ def test_pane_tty_is_resolved_through_tmux(monkeypatch):
|
|||
"tmux", "-L", "test", "display-message", "-p", "-t",
|
||||
"tamq:audit-core", "#{pane_tty}|#{cursor_x}|#{cursor_y}|#{pane_height}|#{alternate_on}",
|
||||
]]
|
||||
|
||||
|
||||
def test_submit_sends_literal_input_then_one_enter(monkeypatch):
|
||||
calls = []
|
||||
|
||||
def run(command, **kwargs):
|
||||
calls.append(command)
|
||||
return type("Result", (), {"returncode": 0, "stderr": ""})()
|
||||
|
||||
monkeypatch.setattr(control.subprocess, "run", run)
|
||||
client = ControlModeClient("tamq", tmux_command=("tmux", "-L", "test"))
|
||||
|
||||
client.submit("tamq:audit-core", "#flex-auth: What's up? [m-1]")
|
||||
|
||||
assert calls == [
|
||||
[
|
||||
"tmux", "-L", "test",
|
||||
"send-keys", "-t", "tamq:audit-core", "-l", "--",
|
||||
"#flex-auth: What's up? [m-1]",
|
||||
";",
|
||||
"send-keys", "-t", "tamq:audit-core", "Enter",
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
def test_submit_surfaces_tmux_rejection(monkeypatch):
|
||||
monkeypatch.setattr(
|
||||
control.subprocess,
|
||||
"run",
|
||||
lambda *args, **kwargs: type(
|
||||
"Result", (), {"returncode": 1, "stderr": "missing pane"}
|
||||
)(),
|
||||
)
|
||||
client = ControlModeClient("tamq")
|
||||
with pytest.raises(ControlModeError, match="missing pane"):
|
||||
client.submit("tamq:missing", "message")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue