Skip to content

Commit

Permalink
Fix bug in test (previously hidden due to missing assert)
Browse files Browse the repository at this point in the history
  • Loading branch information
achimnol committed Jun 25, 2024
1 parent 1c51f6a commit 63b339d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion aiodocker/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def clean_networks(
return result


def clean_filters(filters: Optional[Mapping] = None) -> str:
def clean_filters(filters: Optional[Mapping[str, Any] | Sequence[str]] = None) -> str:
"""
Checks the values inside `filters`
https://docs.docker.com/engine/api/v1.29/#operation/ServiceList
Expand Down
6 changes: 3 additions & 3 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ def test_clean_filters() -> None:
result = {"a": ["1", "2", "3", "4"], "b": ["string"]}
assert utils.clean_filters(filters=filters) == json.dumps(result)

filters = {}
result = {"a": ["1", "2", "3", "4"], "b": ["string"]}
assert utils.clean_filters(filters=filters) == json.dumps(result)
filters2: Sequence[str] = ()
result2: Sequence[str] = []
assert utils.clean_filters(filters=filters2) == json.dumps(result2)

0 comments on commit 63b339d

Please sign in to comment.