Skip to content

Commit

Permalink
update params test
Browse files Browse the repository at this point in the history
  • Loading branch information
calgray committed May 16, 2022
1 parent 8fcbbfc commit f57a36d
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions daliuge-engine/test/test_drop.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
dlg_bool_param,
dlg_int_param,
dlg_list_param,
dlg_dict_param
)
from dlg.droputils import DROPWaiterCtx
from dlg.exceptions import InvalidDropException
Expand Down Expand Up @@ -117,15 +118,23 @@ class MyEnum(Enum):
ONE = "one"

class AssertAppDROP(BarrierAppDROP):
i: int = dlg_int_param("i", 1)
s: str = dlg_string_param("s", "default")
e: MyEnum = dlg_enum_param(MyEnum, "e", "default")
l: list = dlg_list_param("l", [])
l2: list = dlg_list_param("l2", "[]")
b: bool =dlg_bool_param("b", True) # type: ignore
i: int = dlg_int_param("i", 1) # type: ignore
f: float = dlg_float_param("f", 2.0) # type: ignore
s: str = dlg_string_param("s", "default") # type: ignore
e: MyEnum = dlg_enum_param(MyEnum, "e", "default") # type: ignore
l: list = dlg_list_param("l", []) # type: ignore
l2: list = dlg_list_param("l2", "[]") # type: ignore
d: dict = dlg_dict_param("d", {}) # type: ignore
d2: dict = dlg_dict_param("d2", "{}") # type: ignore

def run(self):
assert isinstance(self.b, bool)
assert self.b is True
assert isinstance(self.i, int)
assert self.s is 1
assert self.i == 1
assert isinstance(self.f, float)
assert self.f == 2.0
assert isinstance(self.s, str)
assert self.s is "default"
assert isinstance(self.e, MyEnum)
Expand All @@ -134,6 +143,10 @@ def run(self):
assert self.l == []
assert isinstance(self.l2, list)
assert self.l2 == []
assert isinstance(self.d, dict)
assert self.d == {}
assert isinstance(self.d2, dict)
assert self.d2 == {}

# Nothing fancy, just run it and be done with it
a = NullDROP("a", "a")
Expand Down

0 comments on commit f57a36d

Please sign in to comment.