Пример #1
0
 def test_load(self, mock_open, mock_exists, mock_pickle_load):
     mock_open.return_value = self.context_manager_mock
     mock_exists.return_value = True
     Result.load('kiwi.result')
     mock_open.assert_called_once_with(
         'kiwi.result', 'rb'
     )
     mock_pickle_load.assert_called_once_with(
         self.file_mock
     )
Пример #2
0
 def test_load_failed(self, mock_exists, mock_pickle_load):
     mock_exists.return_value = True
     mock_pickle_load.side_effect = Exception
     Result.load('kiwi.result')
Пример #3
0
 def test_load_result_not_present(self, mock_exists):
     mock_exists.return_value = False
     Result.load('kiwi.result')
Пример #4
0
 def test_load(self, mock_open, mock_exists, mock_pickle_load):
     mock_open.return_value = self.context_manager_mock
     mock_exists.return_value = True
     Result.load('kiwi.result')
     mock_open.assert_called_once_with('kiwi.result', 'rb')
     mock_pickle_load.assert_called_once_with(self.file_mock)
Пример #5
0
 def test_load_failed(self, mock_exists, mock_pickle_load):
     mock_exists.return_value = True
     mock_pickle_load.side_effect = Exception
     Result.load('kiwi.result')
Пример #6
0
 def test_load_result_not_present(self, mock_exists):
     mock_exists.return_value = False
     Result.load('kiwi.result')