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

Function test_stdin

qrcode/tests/test_script.py:27–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25
26@mock.patch("os.isatty", lambda *args: True)
27def 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)

Callers

nothing calls this directly

Calls 1

mainFunction · 0.90

Tested by

no test coverage detected