MCPcopy Index your code
hub / github.com/lincolnloop/python-qrcode / test_print_tty

Function test_print_tty

qrcode/tests/test_qrcode.py:234–246  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

232
233
234def test_print_tty():
235 qr = qrcode.QRCode()
236 f = io.StringIO()
237 f.isatty = lambda: True
238 qr.print_tty(out=f)
239 printed = f.getvalue()
240 f.close()
241 BOLD_WHITE_BG = "\x1b[1;47m"
242 BLACK_BG = "\x1b[40m"
243 WHITE_BLOCK = BOLD_WHITE_BG + " " + BLACK_BG
244 EOL = "\x1b[0m\n"
245 expected = BOLD_WHITE_BG + " " * 23 + EOL + WHITE_BLOCK + " " * 7 + WHITE_BLOCK
246 assert printed[: len(expected)] == expected
247
248
249def test_get_matrix():

Callers

nothing calls this directly

Calls 1

print_ttyMethod · 0.95

Tested by

no test coverage detected