How to use _init_preconfigs method in autotest

Best Python code snippet using autotest_python Github


Full Screen

...11 """12 rel_path = os.path.join(os.path.dirname(__file__), 'preconfigs',13 *suffix)14 return os.path.abspath(rel_path)15 def _init_preconfigs(self):16 """\17 Read the names of all the preconfigs from disk and store them in the18 _preconfigs dictionary.19 """20 if not self._is_init:21 # Read the data22 self._preconfigs['metrics'] = dict.fromkeys(23 os.listdir(self._get_preconfig_path(['metrics'])))24 self._preconfigs['qual'] = dict.fromkeys(25 os.listdir(self._get_preconfig_path(['qual'])))26 self._is_init = True27 def _read_preconfig(self, name, type):28 """\29 Populate the _preconfigs dictionary entry for the preconfig described30 by the given parameters. If the preconfig has already been loaded,31 do nothing.32 name: specific name of the preconfig33 type: 'metrics' or 'qual'34 """35 if self._preconfigs[type][name] is not None:36 return37 self._preconfigs[type][name] = {}38 path = self._get_preconfig_path([type, name])39 config = open(path)40 try:41 for line in config:42 parts = line.split(':')43 self._preconfigs[type][name][parts[0]] = parts[1].strip()44 finally:45 config.close()46 def get_preconfig(self, name, type):47 self._init_preconfigs()48 self._read_preconfig(name, type)49 return self._preconfigs[type][name]50 def all_preconfigs(self):51 self._init_preconfigs()52 return dict(self._preconfigs)...

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:


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

Run autotest 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?