Пример #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'