-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #414 more robust billing currency/plans handling in capabilities
- Loading branch information
Showing
4 changed files
with
31 additions
and
7 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,16 @@ | ||
from openeo.rest.rest_capabilities import RESTCapabilities | ||
|
||
|
||
class TestCapabilities: | ||
def test_currency(self): | ||
assert RESTCapabilities({}).currency() is None | ||
assert RESTCapabilities({"billing": None}).currency() is None | ||
assert RESTCapabilities({"billing": {"currency": "EUR"}}).currency() == "EUR" | ||
|
||
def test_list_plans(self): | ||
assert RESTCapabilities({}).list_plans() == [] | ||
assert RESTCapabilities({"billing": None}).list_plans() == [] | ||
assert RESTCapabilities({"billing": {"plans": []}}).list_plans() == [] | ||
assert RESTCapabilities( | ||
{"billing": {"plans": [{"name": "free"}]}} | ||
).list_plans() == [{"name": "free"}] |