()
| 25 | |
| 26 | @mock.patch("os.isatty", lambda *args: True) |
| 27 | def test_stdin(): |
| 28 | with mock.patch("qrcode.main.QRCode.print_ascii") as mock_print_ascii: |
| 29 | with mock.patch("sys.stdin") as mock_stdin: |
| 30 | mock_stdin.buffer.read.return_value = "testtext" |
| 31 | main([]) |
| 32 | assert mock_stdin.buffer.read.called |
| 33 | mock_print_ascii.assert_called_with(tty=True) |
| 34 | |
| 35 | |
| 36 | @mock.patch("os.isatty", lambda *args: True) |