예제 #1
0
파일: result_test.py 프로젝트: k0da/kiwi-1
 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
파일: result_test.py 프로젝트: k0da/kiwi-1
 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
파일: result_test.py 프로젝트: k0da/kiwi-1
 def test_load_result_not_present(self, mock_exists):
     mock_exists.return_value = False
     Result.load('kiwi.result')