How to use _process_templates method in molecule

Best Python code snippet using molecule_python

_request.py

Source:_request.py Github

copy

Full Screen

...73 self._parse_assertions()74 if skip:75 self._set_state(RequestState.SKIPPED, EARLIER_ERRORS_SKIP)76 else:77 self._process_templates()78 self.name = self._request.pop('name', None)79 self._parse_method_and_params()80 self.options = RequestOptions(self._request)81 @property82 def _request(self):83 return self._processed or self._raw84 def _set_state(self, state, message=None):85 self.state = RequestState(state, message)86 def _process_templates(self):87 try:88 self._processed = self._template_env.resolve_templates(89 self._request)90 except TemplateError as error:91 self._set_state(RequestState.ERROR, message=str(error))92 def _parse_method_and_params(self):93 method_keys = [94 key for key in self._request.keys() if key.upper() in METHODS]95 if not method_keys or len(method_keys) > 1:96 self._set_state(97 RequestState.ERROR,98 NO_HTTP_METHOD)99 return100 self.method = method_keys[0].upper()...

Full Screen

Full Screen

test_molecule.py

Source:test_molecule.py Github

copy

Full Screen

...50 return os.path.join(_role_directory, 'test-role', 'molecule', 'default',51 'molecule.yml')52def test_valid(temp_dir, _molecule_file, _role_directory, _command_args,53 _instance):54 _instance._process_templates('molecule', _command_args, _role_directory)55 data = util.safe_load_file(_molecule_file)56 assert {} == schema_v2.validate(data)57 cmd = sh.yamllint.bake('-s', _molecule_file)58 pytest.helpers.run_command(cmd)59def test_vagrant_driver(temp_dir, _molecule_file, _role_directory,60 _command_args, _instance):61 _command_args['driver_name'] = 'vagrant'62 _instance._process_templates('molecule', _command_args, _role_directory)63 data = util.safe_load_file(_molecule_file)64 assert {} == schema_v2.validate(data)65 cmd = sh.yamllint.bake('-s', _molecule_file)66 pytest.helpers.run_command(cmd)67@pytest.mark.parametrize('driver', [68 ('azure'),69 ('docker'),70 ('ec2'),71 ('gce'),72 ('lxc'),73 ('lxd'),74 ('openstack'),75 ('vagrant'),76])77def test_drivers(driver, temp_dir, _molecule_file, _role_directory,78 _command_args, _instance):79 _command_args['driver_name'] = driver80 _instance._process_templates('molecule', _command_args, _role_directory)81 data = util.safe_load_file(_molecule_file)82 assert {} == schema_v2.validate(data)83 cmd = sh.yamllint.bake('-s', _molecule_file)84 pytest.helpers.run_command(cmd)85def test_verifier_lint_when_verifier_inspec(86 temp_dir, _molecule_file, _role_directory, _command_args, _instance):87 _command_args['verifier_name'] = 'inspec'88 _command_args['verifier_lint_name'] = 'rubocop'89 _instance._process_templates('molecule', _command_args, _role_directory)90 data = util.safe_load_file(_molecule_file)91 assert {} == schema_v2.validate(data)92 cmd = sh.yamllint.bake('-s', _molecule_file)93 pytest.helpers.run_command(cmd)94def test_verifier_lint_when_verifier_goss(95 temp_dir, _molecule_file, _role_directory, _command_args, _instance):96 _command_args['verifier_name'] = 'goss'97 _command_args['verifier_lint_name'] = 'yamllint'98 _instance._process_templates('molecule', _command_args, _role_directory)99 data = util.safe_load_file(_molecule_file)100 assert {} == schema_v2.validate(data)101 cmd = sh.yamllint.bake('-s', _molecule_file)...

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 molecule 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