How to use _merge_extensions method in lisa

Best Python code snippet using lisa_python

runbook.py

Source:runbook.py Github

copy

Full Screen

...206 # serialize back for loading together207 return [208 variable.to_dict() for variable in variables_from_include # type: ignore209 ]210 def _merge_extensions(211 self,212 merged_path: Path,213 data_from_include: Dict[str, Any],214 data_from_current: Dict[str, Any],215 ) -> List[Any]:216 old_extensions = self._load_extensions(merged_path, data_from_include)217 extensions = self._load_extensions(merged_path, data_from_current)218 # remove duplicate paths219 for old_extension in old_extensions:220 for extension in extensions:221 if extension.path == old_extension.path:222 if not old_extension.name:223 # specify name as possible224 old_extension.name = extension.name225 extensions.remove(extension)226 break227 if extensions or old_extensions:228 # don't change the order, old ones should be imported earlier.229 old_extensions.extend(extensions)230 extensions = old_extensions231 return extensions232 def _merge_data(233 self,234 merged_path: Path,235 data_from_include: Dict[str, Any],236 data_from_current: Dict[str, Any],237 ) -> Dict[str, Any]:238 """239 Merge included data to data_from_current. The current data has240 higher precedence.241 """242 result = data_from_include.copy()243 # merge others244 result.update(data_from_current)245 # merge variables, latest should be effective last246 variables = self._merge_variables(247 merged_path, data_from_include, data_from_current248 )249 if variables:250 result[constants.VARIABLE] = variables251 # merge extensions252 extensions = self._merge_extensions(253 merged_path, data_from_include, data_from_current254 )255 if extensions:256 result[constants.EXTENSION] = extensions257 return result258 def _load_data(259 self,260 path: Path,261 used_path: Set[str],262 higher_level_variables: Union[List[str], Dict[str, VariableEntry]],263 ) -> Any:264 """265 Load runbook, but not to validate. It will be validated after266 extensions are imported. To support partial runbooks, it loads...

Full Screen

Full Screen

deploy.py

Source:deploy.py Github

copy

Full Screen

...72 def _deploy(self, deployment_config, channel, spec_config):73 raise NotImplementedError("Subclass must override _deploy")74 def _load_spec(self, channel):75 spec_config = yaml.safe_load(channel.spec)76 return self._merge_extensions(spec_config)77 def _merge_extensions(self, spec_config):78 """This naively overwrites the value of the given key if present79 We may choose to do some smart merging supporting nested dictionaries at a later80 point but for now this simple behavior is sufficient81 """82 if not self._spec_extension:83 return spec_config84 self._log_changes(spec_config)85 spec_config.update(self._spec_extension)86 return spec_config87 def _log_changes(self, spec_config):88 for key in self._spec_extension:89 if key in spec_config:90 LOG.debug("Overwriting spec: " + key +91 "=" + str(self._spec_extension[key]) +...

Full Screen

Full Screen

config.py

Source:config.py Github

copy

Full Screen

...51 ret = 152 elif value == 'quiet':53 ret = 054 return ret55def _merge_extensions(instance, hp):56 if instance.extension is not None:57 for ext in hp:58 instance.extensions.add(ext)59 else:60 instance.extensions = set()61def _parse_extensions(instance, lst):62 parse_assert(isinstance(lst, list), 'While parsing config file: Expected a list of string for `extensions`.')63 parse_assert(all([isinstance(x, str) for x in lst]), 'While parsing config file: '64 'Expected a list of string for `extensions`.')65 return set(lst)66def _argument_merger(instance, hp):67 if instance.arguments is None:68 instance.arguments = hp69 else:...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run lisa automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful