def test_is_legacy_xcode_package_no_runtime(self, mock_glob, mock_rmtree): test_xcode_path = 'test/path/Xcode.app/' xcode_runtime_paths = [] mock_glob.return_value = xcode_runtime_paths self.assertFalse(xcode_util._is_legacy_xcode_package(test_xcode_path)) mock_glob.assert_called_with( os.path.join(test_xcode_path, self.xcode_runtime_dir_rel_path, '*.simruntime')) self.assertFalse(mock_rmtree.called)
def test_is_legacy_xcode_package_legacy(self, mock_glob, mock_rmtree): test_xcode_path = 'test/path/Xcode.app/' runtime_names = ['iOS.simruntime', 'iOS 12.4.simruntime'] xcode_runtime_paths = [ os.path.join(test_xcode_path, self.xcode_runtime_dir_rel_path, runtime_name) for runtime_name in runtime_names ] mock_glob.return_value = xcode_runtime_paths self.assertTrue(xcode_util._is_legacy_xcode_package(test_xcode_path)) mock_glob.assert_called_with( os.path.join(test_xcode_path, self.xcode_runtime_dir_rel_path, '*.simruntime')) self.assertFalse(mock_rmtree.called)
def test_is_legacy_xcode_package_not_legacy(self, mock_exists): self.assertFalse( xcode_util._is_legacy_xcode_package('test/path/Xcode.app')) mock_exists.assert_called_with('test/path/Xcode.app/' + self.xcode_runtime_rel_path)