Files
receipt_maker/tests/conftest.py
T
adamfandClaude Opus 5.5 30d1b83817
CI / test (3.10) (push) Failing after 47s
CI / test (3.12) (push) Failing after 54s
CI / test (3.13) (push) Failing after 48s
Add a note text size option; document the printer cabled to stppi
- note --size 1|2|3 magnifies the text and wraps to 48/24/16 columns,
  then resets the printer to normal size
- Web page gets a Size menu defaulting to Large; the API validates it
- README/CLAUDE.md: the printer has no Wi-Fi (UB-E04 needs an adapter),
  so it is cabled to stppi's eth0 at 192.168.192.168

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 21:48:54 +01:00

42 lines
931 B
Python

"""Shared test fakes."""
import argparse
class FakePrinter:
"""Records escpos calls instead of talking to hardware."""
def __init__(self):
self.calls = []
def textln(self, text=""):
self.calls.append(("textln", text))
def image(self, img, **kwargs):
self.calls.append(("image", img))
def qr(self, content, **kwargs):
self.calls.append(("qr", content))
def set(self, **kwargs):
self.calls.append(("set", kwargs))
def cut(self):
self.calls.append(("cut", None))
def close(self):
self.calls.append(("close", None))
def make_args(**overrides):
defaults = {
"usb": True, # avoids the network setup script in tests
"ip": "192.168.192.168",
"port": 9100,
"timestamp": False,
"message": None,
"name": None,
}
defaults.update(overrides)
return argparse.Namespace(**defaults)