diff --git a/tests/units/tokens/abstract/test_abstract_token.py b/tests/units/tokens/abstract/test_abstract_token.py index d4f285d..b789bd5 100644 --- a/tests/units/tokens/abstract/test_abstract_token.py +++ b/tests/units/tokens/abstract/test_abstract_token.py @@ -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( diff --git a/tests/units/tokens/test_timeout_token.py b/tests/units/tokens/test_timeout_token.py index 0371ae3..2368244 100644 --- a/tests/units/tokens/test_timeout_token.py +++ b/tests/units/tokens/test_timeout_token.py @@ -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( @@ -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(