Fix security, robustness, and config-drift issues
- Close printer handles (contextlib.closing) in CLI and TUI - Whitelist 4chan image extensions + numeric tim (path traversal) - Cap downloads at 16 MB - clean: unlink instead of rmtree, cover legacy dir, add -y flag - TUI: escape captured output as rich Text; propagate failure exit code - Pass --ip/--port through to connect_receipt.sh via env - Fix double-space textln calls - CI matrix 3.10/3.12/3.13 - pytest pythonpath so tests run without editable install - Print retry narrowed to OSError/escpos errors Co-Authored-By: Claude Code <[email protected]>
This commit is contained in:
+5
-1
@@ -24,6 +24,9 @@ class FakePrinter:
|
||||
def cut(self):
|
||||
self.calls.append(("cut", None))
|
||||
|
||||
def close(self):
|
||||
self.calls.append(("close", None))
|
||||
|
||||
|
||||
def make_base_args(**overrides):
|
||||
defaults = {
|
||||
@@ -50,7 +53,8 @@ def test_run_action_note(fake_printer):
|
||||
|
||||
assert rc == 0
|
||||
assert ("textln", "hello") in fake_printer.calls
|
||||
assert fake_printer.calls[-1] == ("cut", None)
|
||||
assert fake_printer.calls[-2] == ("cut", None)
|
||||
assert fake_printer.calls[-1] == ("close", None) # handle released after action
|
||||
|
||||
|
||||
def test_run_action_qr(fake_printer):
|
||||
|
||||
Reference in New Issue
Block a user