MCPcopy Index your code
hub / github.com/python/cpython / test_stdin_binary_mode

Method test_stdin_binary_mode

Lib/test/test_fileinput.py:237–242  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

235 FileInput(mode=mode)
236
237 def test_stdin_binary_mode(self):
238 with mock.patch('sys.stdin') as m_stdin:
239 m_stdin.buffer = BytesIO(b'spam, bacon, sausage, and spam')
240 fi = FileInput(files=['-'], mode='rb')
241 lines = list(fi)
242 self.assertEqual(lines, [b'spam, bacon, sausage, and spam'])
243
244 def test_detached_stdin_binary_mode(self):
245 orig_stdin = sys.stdin

Callers

nothing calls this directly

Calls 4

BytesIOClass · 0.90
FileInputClass · 0.90
listClass · 0.85
assertEqualMethod · 0.45

Tested by

no test coverage detected