-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(open datasoft): added more dataloader methods for opendata soft …
…catallogues [2024-11-27]
- Loading branch information
1 parent
64dc7fe
commit 3b1123a
Showing
4 changed files
with
235 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import pytest | ||
from HerdingCats.session.cat_session import CatSession | ||
from HerdingCats.explorer.cat_explore import OpenDataSoftCatExplorer | ||
import requests | ||
from loguru import logger | ||
|
||
CATALOGUES = ["https://ukpowernetworks.opendatasoft.com"] | ||
|
||
@pytest.mark.parametrize("catalogue_url", CATALOGUES) | ||
def test_package_list_dictionary(catalogue_url): | ||
""" | ||
Test the package list functionality for predefined data catalogues | ||
""" | ||
with CatSession(catalogue_url) as cat_session: | ||
explorer = OpenDataSoftCatExplorer(cat_session) | ||
try: | ||
results = explorer.fetch_all_datasets() | ||
|
||
print(results) | ||
|
||
# Assert that we got a result | ||
assert results is not None, f"No results returned for {catalogue_url}" | ||
|
||
logger.info(f"Package search test passed for {catalogue_url}") | ||
except requests.RequestException as e: | ||
pytest.fail( | ||
f"Failed to perform package search for {catalogue_url}: {str(e)}" | ||
) | ||
except AssertionError as e: | ||
pytest.fail(str(e)) |