def test_set_doi_summaries(self) -> None: collection = self.collection.clone() sci_summaries = ScientificExtension.summaries(collection) sci_summaries.doi = [PUB2_DOI] new_dois = ScientificExtension.summaries(collection).doi assert new_dois is not None self.assertListEqual([PUB2_DOI], new_dois)
def test_summaries_adds_uri(self) -> None: collection = self.collection.clone() collection.stac_extensions = [] self.assertRaisesRegex( pystac.ExtensionNotImplemented, r"Could not find extension schema URI.*", ScientificExtension.summaries, collection, False, ) _ = ScientificExtension.summaries(collection, True) self.assertIn(ScientificExtension.get_schema_uri(), collection.stac_extensions) ScientificExtension.remove_from(collection) self.assertNotIn(ScientificExtension.get_schema_uri(), collection.stac_extensions)
def test_set_citation_summaries(self) -> None: collection = self.collection.clone() sci_summaries = ScientificExtension.summaries(collection) sci_summaries.citation = None self.assertIsNone(sci_summaries.citation)
def test_get_doi_summaries(self) -> None: dois = ScientificExtension.summaries(self.collection).doi assert dois is not None self.assertListEqual([PUB1_DOI, PUB2_DOI], dois)
def test_get_citation_summaries(self) -> None: citations = ScientificExtension.summaries(self.collection).citation assert citations is not None self.assertListEqual([CITATION], citations)