コード例 #1
0
 def test_Unzip_Linux(self, mock_UnzipUsingCommand, mock_MakeDirectory):
     self.mock_bisect_utils.IsLinuxHost.return_value = True
     self.mock_bisect_utils.IsMacHost.return_value = False
     self.mock_bisect_utils.IsWindowsHost.return_value = False
     fetch_build.Unzip('x.zip', 'out_dir', verbose=False)
     mock_MakeDirectory.assert_called_with('out_dir')
     mock_UnzipUsingCommand.assert_called_with(['unzip', '-o'], 'x.zip',
                                               'out_dir')
コード例 #2
0
 def test_Unzip_Mac_LargeFile(self, mock_UnzipUsingZipFile,
                              mock_MakeDirectory):
     # The zipfile module is used to unzip on mac when the file is > 4GB.
     self.mock_bisect_utils.IsLinuxHost.return_value = False
     self.mock_bisect_utils.IsMacHost.return_value = True
     self.mock_bisect_utils.IsWindowsHost.return_value = False
     self.mock_os.path.getsize.return_value = 2**33  # 8GB
     fetch_build.Unzip('x.zip', 'out_dir', verbose=False)
     mock_MakeDirectory.assert_called_with('out_dir')
     mock_UnzipUsingZipFile.assert_called_with('x.zip', 'out_dir', False)