Пример #1
0
 def test_unpack_cache_cache_dest_not_exist(self, mock_os, mock_os_path,
                                            mock_cache_file,
                                            mock_subprocess):
     mock_os_path.isdir.return_value = True
     mock_cache_file.return_value = 'cache_file'
     mock_os_path.exists.return_value = False
     mock_os.listdir.return_value = ['listdir', 'is', 'Mocked']
     unpack_cache('dest_dir', cache_dir='cache_dir')
Пример #2
0
 def test_unpack_cache_tar_failure(self, mock_os, mock_os_path,
                                   mock_cache_file,
                                   mock_subprocess):
     mock_os_path.isdir.return_value = True
     mock_cache_file.return_value = 'cache_file'
     mock_os_path.exists.return_value = False
     mock_subprocess.side_effect = subprocess.CalledProcessError(1, 'cmd')
     unpack_cache('dest_dir', cache_dir='cache_dir')