def test_1070(self): """SciMeta.validate(): Invalid EML 2.1.1: Missing child element""" xml_str = self.test_files.load_bin('scimeta_eml_invalid_2.xml') format_id = 'eml://ecoinformatics.org/eml-2.1.1' with pytest.raises(scimeta.SciMetaValidationError, match='Missing child element'): scimeta.validate(format_id, xml_str)
def test_1070(self): """SciMeta.validate(): Invalid EML 2.1.1: Missing child element""" xml_str = self.sample.load('scimeta_eml_invalid_2.xml') format_id = 'eml://ecoinformatics.org/eml-2.1.1' with pytest.raises(lxml.etree.DocumentInvalid, match='Missing child element'): scimeta.validate(format_id, xml_str)
def test_1060(self): """SciMeta.validate(): Invalid EML 2.1.1: Unexpected element""" xml_str = self.sample.load('scimeta_eml_invalid_1.xml') format_id = 'eml://ecoinformatics.org/eml-2.1.1' with pytest.raises( scimeta.SciMetaValidationError, match='unexpectedElement' ): scimeta.validate(format_id, xml_str)
def test_1010(self): """SciMeta.validate(): Unknown formatId raises SciMetaValidationError with expected message""" xml_str = self.test_files.load_bin('scimeta_isotc211_1.xml') format_id = 'unknown_format_id' with pytest.raises(scimeta.SciMetaValidationError, match='Invalid Science Metadata'): scimeta.validate(format_id, xml_str)
def test_1000(self): """SciMeta.validate(): Uninstalled schema raises SciMetaValidationError with expected message""" xml_str = self.sample.load('scimeta_isotc211_1.xml') format_id = 'http://www.icpsr.umich.edu/DDI' with pytest.raises(scimeta.SciMetaValidationError, match='Schema not installed for Science Metadata'): scimeta.validate(format_id, xml_str)
def test_1040(self): """SciMeta.validate(): ISO/TC 211 does not validate as Dryad""" xml_str = self.sample.load('scimeta_isotc211_1.xml') format_id = 'http://datadryad.org/profile/v3.1' with pytest.raises( scimeta.SciMetaValidationError, match='No matching global declaration available for the validation root' ): scimeta.validate(format_id, xml_str)
def test_1020(self): """SciMeta.validate(): onedcx does not validate as EML""" xml_str = self.sample.load('scimeta_dc_1.xml') format_id = 'eml://ecoinformatics.org/eml-2.1.1' with pytest.raises( scimeta.SciMetaValidationError, match='No matching global declaration available for the validation root' ): scimeta.validate(format_id, xml_str)
def test_1050(self): """SciMeta.validate(): Valid EML 2.1.1""" xml_str = self.sample.load('scimeta_eml_valid.xml') format_id = 'eml://ecoinformatics.org/eml-2.1.1' scimeta.validate(format_id, xml_str)
def test_1030(self): """SciMeta.validate(): onedcx validates successfully as DataONE Dublin Core Extended""" xml_str = self.sample.load('scimeta_dc_1.xml') format_id = 'http://ns.dataone.org/metadata/schema/onedcx/v1.0' scimeta.validate(format_id, xml_str)
def test_1040(self): """SciMeta.validate(): ISO/TC 211 does not validate as Dryad""" xml_str = self.sample.load('scimeta_isotc211_1.xml') format_id = 'http://datadryad.org/profile/v3.1' with pytest.raises(lxml.etree.DocumentInvalid): scimeta.validate(format_id, xml_str)
def test_1020(self): """SciMeta.validate(): onedcx does not validate as EML""" xml_str = self.sample.load('scimeta_dc_1.xml') format_id = 'eml://ecoinformatics.org/eml-2.1.1' with pytest.raises(lxml.etree.DocumentInvalid): scimeta.validate(format_id, xml_str)