def test_flushes_stream_after_input(self):
# issue 7208
with mock.patch('os.open') as open, \
mock.patch('io.FileIO'), \
mock.patch('io.TextIOWrapper'), \
mock.patch('termios.tcgetattr'), \
mock.patch('termios.tcsetattr'):
open.return_value = 3
mock_stream = mock.Mock(spec=StringIO)
getpass.unix_getpass(stream=mock_stream)
mock_stream.flush.assert_called_with()
评论列表
文章目录