예제 #1
0
    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)
예제 #2
0
    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)
예제 #3
0
    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)
예제 #4
0
    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)
예제 #5
0
    def test_get_citation_summaries(self) -> None:
        citations = ScientificExtension.summaries(self.collection).citation

        assert citations is not None
        self.assertListEqual([CITATION], citations)