Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TEST: don't parametrize config #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions tests/test_typed_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def __call__(self, length: float, is_metric: bool) -> str:

def test_explicit_action_many_of_one_type() -> None:
class DoubleValue(TypedAction[float]):
CONFIG = ActionConfig[float](
CONFIG = ActionConfig(
INPUT=({"value": Signature(type_=float)}), OUTPUT=Signature(key="doubled_value", type_=float)
)

Expand All @@ -89,7 +89,7 @@ def __call__(self, value: float) -> float:

def test_explicit_action_with_already_existing_name() -> None:
class DoubleValue(TypedAction[float]):
CONFIG = ActionConfig[float](
CONFIG = ActionConfig(
INPUT=({"value": Signature(type_=float)}), OUTPUT=Signature(key="doubled_value", type_=float)
)

Expand All @@ -106,7 +106,7 @@ class Payment:
amount: float

class MergeFirstTwoPayments(TypedAction[Payment]):
CONFIG = ActionConfig[Payment](
CONFIG = ActionConfig(
INPUT={
"first": Signature(type_=Payment, tags={"first_payment"}),
"second": Signature(type_=Payment, tags={"second_payment"}),
Expand Down Expand Up @@ -158,7 +158,7 @@ def __call__(self, user: User) -> None:
self.sent_emails_to.append(user)

class IsSuperUser(TypedAction[bool]):
CONFIG = ActionConfig[bool](
CONFIG = ActionConfig(
INPUT={"user": Signature(type_=User)}, OUTPUT=Signature(key="is_super_user", type_=bool)
)

Expand Down Expand Up @@ -241,7 +241,7 @@ def __call__(self, value: float) -> bool:

def test_explicit_condition() -> None:
class IsPositive(TypedCondition):
CONFIG = ActionConfig[bool](INPUT={"value": Signature(key="value")})
CONFIG = ActionConfig(INPUT={"value": Signature(key="value")})

def __call__(self, value: float) -> bool:
return value >= 0
Expand Down