示例#1
0
 def test_input5(self):
     with mock.patch('builtins.input') as mock_input:
         mock_input.return_value = 'test'
         assert read_input() == 'test'
示例#2
0
 def test_input4(self):
     mock_input = MagicMock(return_value='test')
     with mock.patch('builtins.input', mock_input):
         assert read_input() == 'test'
示例#3
0
 def test_input2(self):
     assert read_input() == 'test'
示例#4
0
 def test_input3(self, mock_input):
     assert read_input() == 'test'
     assert mock_input.call_count == 1
     assert mock_input.called
示例#5
0
 def test_input1(self):
     with mock.patch('builtins.input', return_value='test'):
         assert read_input() == 'test'