This repository has been archived by the owner on Nov 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from ecmwf-projects/fix-accept-licence
fix accept licence
- Loading branch information
Showing
4 changed files
with
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import pytest | ||
|
||
from cads_api_client import ApiClient | ||
|
||
|
||
@pytest.fixture | ||
def api_client(api_root_url: str, api_key: str) -> ApiClient: | ||
return ApiClient(url=api_root_url, key=api_key) | ||
|
||
|
||
def test_accept_licence(api_client: ApiClient) -> None: | ||
licence = api_client.licences["licences"][0] | ||
licence_id = licence["id"] | ||
licence_revision = licence["revision"] | ||
|
||
expected = {"id": licence_id, "revision": licence_revision} | ||
actual = api_client.accept_licence(licence_id, licence_revision) | ||
assert expected == actual | ||
|
||
assert any( | ||
[ | ||
licence["id"] == licence_id and licence["revision"] == licence_revision | ||
for licence in api_client.accepted_licences["licences"] | ||
] | ||
) |
File renamed without changes.