Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
anikaweinmann committed Dec 21, 2023
1 parent 1e8204b commit 658c635
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/actinia/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,14 @@ def create_actinia_pc_item(
some valid GRASS or actinia module
inputs: list or dict
list of input parameters with values in the form
[{"param": key1, "value": value1}, {"param": key2, "value": value2}, ...]
[{"param": key1, "value": value1}, {"param": key2, "value": value2},
...]
shorter alternative as dict
{"key1": value1, "key2": value2, ...}
outputs: list or dict
list of output parameters with values in the form
[{"param": key1, "value": value1}, {"param": key2, "value": value2}, ...]
[{"param": key1, "value": value1}, {"param": key2, "value": value2},
...]
shorter alternative as dict
{"key1": value1, "key2": value2, ...}
flags: str
Expand Down
12 changes: 9 additions & 3 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@
__copyright__ = "Copyright 2023, mundialis GmbH & Co. KG"
__maintainer__ = "Anika Weinmann"

from actinia.utils import *
import pytest

from actinia.utils import (
create_actinia_pc_item,
request_and_check,
set_job_names,
)
from .actinia_config import ACTINIA_BASEURL, ACTINIA_VERSION, ACTINIA_AUTH


Expand All @@ -43,7 +49,7 @@ def test_request_and_check_wrong_url(self):
url = f"{ACTINIA_BASEURL}api/{ACTINIA_VERSION}/version_fail"
err_msg = "The requested URL was not found on the server."
with pytest.raises(Exception) as excinfo:
resp = request_and_check(url, ACTINIA_AUTH, status_code=200)
request_and_check(url, ACTINIA_AUTH, status_code=200)
assert err_msg in str(excinfo.value)

def test_request_and_check_wrong_auth(self):
Expand All @@ -52,7 +58,7 @@ def test_request_and_check_wrong_auth(self):
err_msg = "Unauthorized Access"
wrong_auth = ("actinia-gdi", "wrong_pw")
with pytest.raises(Exception) as excinfo:
resp = request_and_check(url, wrong_auth, status_code=200)
request_and_check(url, wrong_auth, status_code=200)
assert err_msg in str(excinfo.value)

def test_set_job_names(self):
Expand Down

0 comments on commit 658c635

Please sign in to comment.