From 1c04a80b58a03b571640c12455e51311b72d9846 Mon Sep 17 00:00:00 2001 From: aelkheir <90580077+aelkheir@users.noreply.github.com> Date: Tue, 25 Feb 2025 23:52:12 +0300 Subject: [PATCH 1/3] Add `InputMedia(.*).thumbnail` to complex types. --- tests/test_official/exceptions.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_official/exceptions.py b/tests/test_official/exceptions.py index fab6bf2861c..449d5d508a6 100644 --- a/tests/test_official/exceptions.py +++ b/tests/test_official/exceptions.py @@ -97,6 +97,9 @@ class ParamTypeCheckingExceptions: "Input(Paid)?Media.*": { "media": str, # actual: Union[str, InputMedia*, FileInput] }, + "Input(Paid)?Media(?!Photo).*": { + "thumbnail": str, # actual: Union[str, FileInput] + }, "EncryptedPassportElement": { "data": str, # actual: Union[IdDocumentData, PersonalDetails, ResidentialAddress] }, From 716a00027c33c3d62d00e8e39e5eb262a7f55448 Mon Sep 17 00:00:00 2001 From: aelkheir <90580077+aelkheir@users.noreply.github.com> Date: Tue, 25 Feb 2025 23:55:01 +0300 Subject: [PATCH 2/3] Use existing class selector regex instead. --- tests/test_official/exceptions.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/test_official/exceptions.py b/tests/test_official/exceptions.py index 449d5d508a6..eef379c469e 100644 --- a/tests/test_official/exceptions.py +++ b/tests/test_official/exceptions.py @@ -96,8 +96,6 @@ class ParamTypeCheckingExceptions: }, "Input(Paid)?Media.*": { "media": str, # actual: Union[str, InputMedia*, FileInput] - }, - "Input(Paid)?Media(?!Photo).*": { "thumbnail": str, # actual: Union[str, FileInput] }, "EncryptedPassportElement": { From 55411674bb6f7d76d6cd9c36467e0c24a51a4b35 Mon Sep 17 00:00:00 2001 From: Bibo-Joshi <22366557+Bibo-Joshi@users.noreply.github.com> Date: Wed, 26 Feb 2025 21:31:34 +0100 Subject: [PATCH 3/3] add a comment --- tests/test_official/exceptions.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_official/exceptions.py b/tests/test_official/exceptions.py index eef379c469e..a6eb90dbd7e 100644 --- a/tests/test_official/exceptions.py +++ b/tests/test_official/exceptions.py @@ -96,6 +96,7 @@ class ParamTypeCheckingExceptions: }, "Input(Paid)?Media.*": { "media": str, # actual: Union[str, InputMedia*, FileInput] + # see also https://github.com/tdlib/telegram-bot-api/issues/707 "thumbnail": str, # actual: Union[str, FileInput] }, "EncryptedPassportElement": {