Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_valid(temp_dir, _molecule_file, _role_directory, _command_args, _instance):
_instance._process_templates('molecule', _command_args, _role_directory)
data = util.safe_load_file(_molecule_file)
assert {} == schema_v2.validate(data)
cmd = sh.yamllint.bake('-s', _molecule_file)
pytest.helpers.run_command(cmd)
def test_verifier_lint_when_verifier_inspec(
temp_dir, _molecule_file, _role_directory, _command_args, _instance
):
_command_args['verifier_name'] = 'inspec'
_command_args['verifier_lint_name'] = 'rubocop'
_instance._process_templates('molecule', _command_args, _role_directory)
data = util.safe_load_file(_molecule_file)
assert {} == schema_v2.validate(data)
cmd = sh.yamllint.bake('-s', _molecule_file)
pytest.helpers.run_command(cmd)
def _get_instance_config(self, instance_name):
instance_config_dict = util.safe_load_file(self._config.driver.instance_config)
return next(
item for item in instance_config_dict if item['instance'] == instance_name
)
def _get_instance_config(self, instance_name):
instance_config_dict = util.safe_load_file(self._config.driver.instance_config)
return next(
item for item in instance_config_dict if item['instance'] == instance_name
)
def _get_instance_config(self, instance_name):
instance_config_dict = util.safe_load_file(self._config.driver.instance_config)
return next(
item for item in instance_config_dict if item['instance'] == instance_name
)
def _get_instance_config(self, instance_name):
instance_config_dict = util.safe_load_file(self._config.driver.instance_config)
return next(
item for item in instance_config_dict if item["instance"] == instance_name
)
def _load_file(self):
return util.safe_load_file(self.state_file)