Beispiel #1
0
    def test_get_registry_url_no_doi(self) -> None:
        # Get the example collection as a dict and remove the sci:doi property
        collection_dict: Dict[str, Any] = Collection.fetch(
            'ref_african_crops_kenya_02_labels').to_dict()
        collection_dict.pop('sci:doi', None)
        collection: Collection = Collection.from_dict(collection_dict)

        assert collection.registry_url is None
Beispiel #2
0
    def test_anonymous_archive_size(self, requests_mock: "Mocker_Type",
                                    root_url: str) -> None:
        collection_id = 'bigearthnet_v1_source'
        example_collection = Path(
            __file__).parent / "data" / "bigearthnet_v1_source.json"
        with open(example_collection) as src:
            collection = Collection.from_dict(json.load(src),
                                              profile="__anonymous__")

        info_url = urljoin(root_url, f'archive/{collection_id}/info')
        requests_mock.get(info_url, json={})

        _ = collection.archive_size

        history = requests_mock.request_history

        actual_url = history[0].url
        qs = parse_qs(urlsplit(actual_url).query)
        assert "key" not in qs