Skip to content

Commit

Permalink
old tests fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
pomponchik committed Aug 7, 2024
1 parent ba632f8 commit 81dcee0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 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 @@ -173,10 +173,14 @@ def test_add_not_temp_tokens(first_token_fabric, second_token_fabric):
def test_add_temp_tokens(first_token_class, second_token_class, first_arguments, second_arguments):
tokens_sum = first_token_class(*first_arguments) + second_token_class(*second_arguments)

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 not (first_token_class is TimeoutToken and second_token_class is TimeoutToken):
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
else:
assert isinstance(tokens_sum, TimeoutToken)
assert len(tokens_sum.tokens) == 0


@pytest.mark.parametrize(
Expand Down
5 changes: 1 addition & 4 deletions tests/units/tokens/test_simple_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,9 @@ def test_sum_of_2_temp_timeout_tokens_throw_right_temp_simple_token():
token = TimeoutToken(1) + SimpleToken(TimeoutToken(2))

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

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


def test_sum_of_2_temp_timeout_tokens_throw_left_temp_simple_token():
token = SimpleToken(TimeoutToken(1)) + TimeoutToken(2)
Expand Down

0 comments on commit 81dcee0

Please sign in to comment.