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

Function test_print_ascii

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

Source from the content-addressed store, hash-verified

206
207
208def test_print_ascii():
209 qr = qrcode.QRCode(border=0)
210 f = io.StringIO()
211 qr.print_ascii(out=f)
212 printed = f.getvalue()
213 f.close()
214 expected = "\u2588\u2580\u2580\u2580\u2580\u2580\u2588"
215 assert printed[: len(expected)] == expected
216
217 f = io.StringIO()
218 f.isatty = lambda: True
219 qr.print_ascii(out=f, tty=True)
220 printed = f.getvalue()
221 f.close()
222 expected = "\x1b[48;5;232m\x1b[38;5;255m" + "\xa0\u2584\u2584\u2584\u2584\u2584\xa0"
223 assert printed[: len(expected)] == expected
224
225
226def test_print_tty_stdout():

Callers

nothing calls this directly

Calls 1

print_asciiMethod · 0.95

Tested by

no test coverage detected