From 4b9149ac8f3e2d7e922f45c2f0374046f775ddf6 Mon Sep 17 00:00:00 2001 From: Oleg A Date: Wed, 24 Aug 2022 11:08:20 +0300 Subject: [PATCH] tests: add representation coverage #988 --- tests/test_api/test_types/test_exception.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/test_api/test_types/test_exception.py diff --git a/tests/test_api/test_types/test_exception.py b/tests/test_api/test_types/test_exception.py new file mode 100644 index 00000000..909f03cb --- /dev/null +++ b/tests/test_api/test_types/test_exception.py @@ -0,0 +1,15 @@ +import pytest + +from aiogram.exceptions import DetailedAiogramError + + +class TestException: + @pytest.mark.parametrize( + "message,result", + [ + ["reason", "DetailedAiogramError('reason')"], + ], + ) + def test_representation(self, message: str, result: bool): + exc = DetailedAiogramError(message=message) + assert repr(exc) == result