Skip to content

Commit

Permalink
all old tests fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
pomponchik committed Aug 8, 2024
1 parent c4116cd commit 432336c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
12 changes: 8 additions & 4 deletions tests/units/tokens/abstract/test_abstract_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,14 @@ def test_add_temp_token_and_not_temp_token(first_token_class, second_token_class
second_token = second_token_class(*second_arguments)
tokens_sum = first_token_class(*first_arguments) + second_token

assert isinstance(tokens_sum, first_token_class)
assert len(tokens_sum.tokens) == 1
assert isinstance(tokens_sum.tokens[0], second_token_class)
assert len(tokens_sum.tokens[0].tokens) == 0
if first_token_class is TimeoutToken and second_token_class is TimeoutToken:
assert isinstance(tokens_sum, TimeoutToken)
assert len(tokens_sum.tokens) == 0
else:
assert isinstance(tokens_sum, first_token_class)
assert len(tokens_sum.tokens) == 1
assert isinstance(tokens_sum.tokens[0], second_token_class)
assert len(tokens_sum.tokens[0].tokens) == 0


@pytest.mark.parametrize(
Expand Down
15 changes: 4 additions & 11 deletions tests/units/tokens/test_timeout_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,11 +341,8 @@ def test_bigger_temp_timeout_token_plus_less_temp_timeout_token_with_same_monoto
token = TimeoutToken(2, **addictional_kwargs) + TimeoutToken(1, **addictional_kwargs)

assert isinstance(token, TimeoutToken)
assert token.timeout == 2
assert len(token.tokens) == 1
assert len(token.tokens[0].tokens) == 0
assert isinstance(token.tokens[0], TimeoutToken)
assert token.tokens[0].timeout == 1
assert token.timeout == 1
assert len(token.tokens) == 0


@pytest.mark.parametrize(
Expand Down Expand Up @@ -514,12 +511,8 @@ def test_bigger_temp_timeout_token_plus_less_timeout_token_with_same_monotonic_f
token = TimeoutToken(2, **addictional_kwargs) + right_timeout_token

assert isinstance(token, TimeoutToken)
assert token.timeout == 2
assert len(token.tokens) == 1
assert len(token.tokens[0].tokens) == 0
assert isinstance(token.tokens[0], TimeoutToken)
assert token.tokens[0].timeout == 1
assert token.tokens[0] is right_timeout_token
assert token.timeout == 1
assert len(token.tokens) == 0


@pytest.mark.parametrize(
Expand Down

0 comments on commit 432336c

Please sign in to comment.