()
| 206 | |
| 207 | |
| 208 | def 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 | |
| 226 | def test_print_tty_stdout(): |
nothing calls this directly
no test coverage detected