def test_add_plugin_corrupted_spec(tmpdir_factory, description, plugin_spec): """Tests that it's not possible to add a plugin with invalid spec file :param tmpdir_factory: pytest builtin fixture for creating temp dirs :param description: test description (adds a description in pytest run) :param plugin_spec: dictionary with data for spec file :return: """ lp_dir = tmpdir_factory.mktemp('test_tmp_dir') lp_file = lp_dir.join('plugin.spec') with open(lp_file.strpath, 'w') as fp: yaml.dump(plugin_spec, fp, default_flow_style=True) try: with pytest.raises(IRValidatorException): SpecValidator.validate_from_file(lp_file.strpath) finally: lp_dir.remove()
def test_add_plugin_corrupted_spec(tmpdir_factory, description, plugin_spec): """Tests that it's not possible to add a plugin with invalid spec file :param tmpdir_factory: pytest builtin fixture for creating temp dirs :param description: test description (adds a description in pytest run) :param plugin_spec: dictionary with data for spec file :return: """ lp_dir = tmpdir_factory.mktemp('test_tmp_dir') lp_file = lp_dir.join('plugin.spec') with open(lp_file.strpath, 'w') as fp: yaml.dump(plugin_spec, fp, default_flow_style=True) try: with pytest.raises(IRValidatorException): SpecValidator.validate_from_file(lp_file.strpath) finally: lp_dir.remove()
def config(self, plugin_spec): self._config = SpecValidator.validate_from_file(plugin_spec)
def config(self, plugin_spec): self._config = SpecValidator.validate_from_file(plugin_spec)