Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
micpst committed Sep 23, 2024
1 parent 8eefd9b commit c28091f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/unit/views/test_methods_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


@dataclass
class TestCallerContext(BaseCallerContext):
class CallerContext(BaseCallerContext):
"""
Mock class for testing context.
"""
Expand All @@ -33,7 +33,7 @@ def method_foo(self, idx: int) -> None:

@view_filter()
def method_bar(
self, cities: List[str], year: Union[Literal["2023", "2024"], TestCallerContext], pairs: List[Tuple[str, int]]
self, cities: List[str], year: Union[Literal["2023", "2024"], CallerContext], pairs: List[Tuple[str, int]]
) -> str:
return f"hello {cities} in {year} of {pairs}"

Expand All @@ -45,7 +45,7 @@ def method_baz(self) -> None:

@view_aggregation()
def method_qux(
self, ages: List[int], years: Union[Literal["2023", "2024"], TestCallerContext], names: List[str]
self, ages: List[int], years: Union[Literal["2023", "2024"], CallerContext], names: List[str]
) -> str:
return f"hello {ages} and {names}"

Expand Down Expand Up @@ -74,7 +74,7 @@ def test_list_filters() -> None:
assert method_bar.description == ""
assert method_bar.parameters == [
MethodParamWithTyping("cities", List[str]),
MethodParamWithTyping("year", Union[Literal["2023", "2024"], TestCallerContext]),
MethodParamWithTyping("year", Union[Literal["2023", "2024"], CallerContext]),
MethodParamWithTyping("pairs", List[Tuple[str, int]]),
]
assert (
Expand All @@ -98,7 +98,7 @@ def test_list_aggregations() -> None:
assert method_qux.description == ""
assert method_qux.parameters == [
MethodParamWithTyping("ages", List[int]),
MethodParamWithTyping("years", Union[Literal["2023", "2024"], TestCallerContext]),
MethodParamWithTyping("years", Union[Literal["2023", "2024"], CallerContext]),
MethodParamWithTyping("names", List[str]),
]
assert str(method_qux) == "method_qux(ages: List[int], years: Literal['2023', '2024'] | Context, names: List[str])"

0 comments on commit c28091f

Please sign in to comment.