-
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.
- Loading branch information
1 parent
1cce6cb
commit 653af72
Showing
4 changed files
with
29 additions
and
21 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 |
---|---|---|
@@ -1,25 +1,32 @@ | ||
import pytest | ||
from HerdingCats.session.cat_session import CkanCatSession | ||
from HerdingCats.session.cat_session import CatSession | ||
|
||
|
||
@pytest.fixture | ||
def domain(): | ||
return "data.london.gov.uk" | ||
|
||
|
||
def test_cat_session_creation(domain): | ||
""" | ||
Check that a valid Ckan session can be created | ||
""" | ||
try: | ||
session = CkanCatSession(domain) | ||
assert isinstance(session, CkanCatSession), "CkanCatSession object should be created" | ||
session = CatSession(domain) | ||
assert isinstance( | ||
session, CatSession | ||
), "CkanCatSession object should be created" | ||
assert session.domain == domain, "CkanCatSession should have the correct domain" | ||
assert session.base_url == f"https://{domain}", "CkanCatSession should have the correct base URL" | ||
assert ( | ||
session.base_url == f"https://{domain}" | ||
), "CkanCatSession should have the correct base URL" | ||
except Exception as e: | ||
pytest.fail(f"Failed to create CkanCatSession: {str(e)}") | ||
|
||
|
||
def test_cat_session_start(domain): | ||
try: | ||
with CkanCatSession(domain) as session: | ||
with CatSession(domain) as session: | ||
assert session.session is not None, "Session object should be created" | ||
except Exception as e: | ||
pytest.fail(f"Failed to start CkanCatSession: {str(e)}") |