Skip to content

Commit

Permalink
add tests for _without_keys
Browse files Browse the repository at this point in the history
  • Loading branch information
ape364 committed May 27, 2024
1 parent 67ee9a0 commit 5b2166c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/extra/generators/test_generator_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,3 +223,17 @@ async def test_get_current_block_error(generator_utils):

assert e.value.message == 'message'
assert e.value.result == 'code'


@pytest.mark.parametrize(
'params, excluded, expected',
[
({'a': 1, 'b': 2, 'c': 3}, ('a', 'b'), {'c': 3}),
({'a': 1, 'b': 2, 'c': 3}, ('b', 'c'), {'a': 1}),
({'a': 1, 'b': 2, 'c': 3}, ('a', 'c'), {'b': 2}),
({'a': 1, 'b': 2, 'c': 3}, ('a', 'b', 'c'), {}),
({'a': 1, 'b': 2, 'c': 3}, ('d', 'e'), {'a': 1, 'b': 2, 'c': 3}),
],
)
def test_without_keys(generator_utils, params, excluded, expected):
assert generator_utils._without_keys(params, excluded) == expected

0 comments on commit 5b2166c

Please sign in to comment.