Beispiel #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
     )
Beispiel #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')
Beispiel #3
0
 def test_load_result_not_present(self, mock_exists):
     mock_exists.return_value = False
     Result.load('kiwi.result')
Beispiel #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)
Beispiel #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')
Beispiel #6
0
 def test_load_result_not_present(self, mock_exists):
     mock_exists.return_value = False
     Result.load('kiwi.result')