mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-04-07 11:20:48 -04:00
dev-python/python-telegram-bot: add 20.5
Signed-off-by: David Roman <davidroman96@gmail.com>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
DIST python-telegram-bot-13.14.tar.gz 2282098 BLAKE2B 549c87737585f3b2b4bae9f9430fcf8dbaf4f9048013f623b5ef910534a0c70792e36eedffa707b4ff68d6de53c69d4befe64618fc8944c35c3efe680294c4a9 SHA512 859d9852feaaf147b608c1ef4e5f388c345f7efcd699a828d690b110fb499cb9391a51bafe8e0b533d106dccf038a4c845fa13c0dab12bb7792dffe5d059af27
|
||||
DIST python-telegram-bot-20.2.tar.gz 1940084 BLAKE2B a575f7ea616e29c32f3773adc66153ddbe4563420697d5eb2dcb1ad7df72d5ea348b0900552d65a91fdfe9c4d65c4fc1d43e9e5e7bb18d5943ae0d329878a6a0 SHA512 1d25a7c0c8b97c3292af364f1c9f94289de340d19587f2d43817f36bd89c3862fe6c1cf58b68dcdfa5aca6a94acb8da99bb49a9f4ad76e3a61b3b59810dae6e5
|
||||
DIST python-telegram-bot-20.3.tar.gz 1957466 BLAKE2B 47e68846bb6c092648aa2bcd53289f7ac78d7335a8f84fd6a1c6440ee8b38c150f2e2df56f537e0de9e01af3c98a49fd0a8d8771c15ebd9be1658b0ee17a355b SHA512 6594eb991a14acdd247505b904ca2bd5022ef8abe4b45b57218508fa53de765a6a9e05c78997723a8385b45a0950e87dc102264ed3338eed9d569d1eb596e1f9
|
||||
DIST python-telegram-bot-20.5.tar.gz 1950471 BLAKE2B b25440dd78d3a72242d371ec661027d2fea7c174a20a1c7482f0d1cab07aa6e5ffa886bb944c217e177732aabec676e5ea6003431a5e893a7171bb36642e3c53 SHA512 65f8d3de73bffcf56dd986091c34fa8f9cb60b4b8bbfc2b1c5c7392cf3a6314192a97013a2299a4d02977fd4f6ae73c487acc7a839b700d7304b02c0f5680671
|
||||
|
||||
@@ -0,0 +1,324 @@
|
||||
diff --git a/tests/_files/test_animation.py b/tests/_files/test_animation.py
|
||||
index 23ec3b50..a7230495 100644
|
||||
--- a/tests/_files/test_animation.py
|
||||
+++ b/tests/_files/test_animation.py
|
||||
@@ -65,6 +65,7 @@ class TestAnimationBase:
|
||||
|
||||
|
||||
class TestAnimationWithoutRequest(TestAnimationBase):
|
||||
+ __test__ = False
|
||||
def test_slot_behaviour(self, animation):
|
||||
for attr in animation.__slots__:
|
||||
assert getattr(animation, attr, "err") != "err", f"got extra slot '{attr}'"
|
||||
diff --git a/tests/_files/test_audio.py b/tests/_files/test_audio.py
|
||||
index 3ea394d0..6a7c47e4 100644
|
||||
--- a/tests/_files/test_audio.py
|
||||
+++ b/tests/_files/test_audio.py
|
||||
@@ -66,6 +66,7 @@ class TestAudioBase:
|
||||
|
||||
|
||||
class TestAudioWithoutRequest(TestAudioBase):
|
||||
+ __test__ = False
|
||||
def test_slot_behaviour(self, audio):
|
||||
for attr in audio.__slots__:
|
||||
assert getattr(audio, attr, "err") != "err", f"got extra slot '{attr}'"
|
||||
@@ -196,6 +197,7 @@ class TestAudioWithoutRequest(TestAudioBase):
|
||||
|
||||
|
||||
class TestAudioWithRequest(TestAudioBase):
|
||||
+ __test__ = False
|
||||
async def test_send_all_args(self, bot, chat_id, audio_file, thumb_file):
|
||||
message = await bot.send_audio(
|
||||
chat_id,
|
||||
diff --git a/tests/_files/test_chatphoto.py b/tests/_files/test_chatphoto.py
|
||||
index d09876e2..65c3e213 100644
|
||||
--- a/tests/_files/test_chatphoto.py
|
||||
+++ b/tests/_files/test_chatphoto.py
|
||||
@@ -61,6 +61,7 @@ class TestChatPhotoBase:
|
||||
|
||||
|
||||
class TestChatPhotoWithoutRequest(TestChatPhotoBase):
|
||||
+ __test__ = False
|
||||
def test_slot_behaviour(self, chat_photo):
|
||||
for attr in chat_photo.__slots__:
|
||||
assert getattr(chat_photo, attr, "err") != "err", f"got extra slot '{attr}'"
|
||||
@@ -155,6 +156,7 @@ class TestChatPhotoWithoutRequest(TestChatPhotoBase):
|
||||
|
||||
|
||||
class TestChatPhotoWithRequest:
|
||||
+ __test__ = False
|
||||
async def test_get_and_download(self, bot, chat_photo, tmp_file):
|
||||
tasks = {bot.get_file(chat_photo.small_file_id), bot.get_file(chat_photo.big_file_id)}
|
||||
asserts = []
|
||||
diff --git a/tests/_files/test_document.py b/tests/_files/test_document.py
|
||||
index f5ccdbeb..f22cef77 100644
|
||||
--- a/tests/_files/test_document.py
|
||||
+++ b/tests/_files/test_document.py
|
||||
@@ -61,6 +61,7 @@ class TestDocumentBase:
|
||||
|
||||
|
||||
class TestDocumentWithoutRequest(TestDocumentBase):
|
||||
+ __test__ = False
|
||||
def test_slot_behaviour(self, document):
|
||||
for attr in document.__slots__:
|
||||
assert getattr(document, attr, "err") != "err", f"got extra slot '{attr}'"
|
||||
@@ -190,6 +191,7 @@ class TestDocumentWithoutRequest(TestDocumentBase):
|
||||
|
||||
|
||||
class TestDocumentWithRequest(TestDocumentBase):
|
||||
+ __test__ = False
|
||||
async def test_error_send_empty_file(self, bot, chat_id):
|
||||
with Path(os.devnull).open("rb") as f, pytest.raises(TelegramError):
|
||||
await bot.send_document(chat_id=chat_id, document=f)
|
||||
diff --git a/tests/_files/test_inputmedia.py b/tests/_files/test_inputmedia.py
|
||||
index f00dd165..bb4252f4 100644
|
||||
--- a/tests/_files/test_inputmedia.py
|
||||
+++ b/tests/_files/test_inputmedia.py
|
||||
@@ -179,6 +179,7 @@ class TestInputMediaVideoWithoutRequest(TestInputMediaVideoBase):
|
||||
assert input_media_video_dict["supports_streaming"] == input_media_video.supports_streaming
|
||||
assert input_media_video_dict["has_spoiler"] == input_media_video.has_spoiler
|
||||
|
||||
+ @pytest.mark.skip(reason="Requires internet connection")
|
||||
def test_with_video(self, video): # noqa: F811
|
||||
# fixture found in test_video
|
||||
input_media_video = InputMediaVideo(video, caption="test 3")
|
||||
@@ -242,7 +243,8 @@ class TestInputMediaPhotoWithoutRequest(TestInputMediaPhotoBase):
|
||||
ce.to_dict() for ce in input_media_photo.caption_entities
|
||||
]
|
||||
assert input_media_photo_dict["has_spoiler"] == input_media_photo.has_spoiler
|
||||
-
|
||||
+
|
||||
+ @pytest.mark.skip(reason="Requires internet connection")
|
||||
def test_with_photo(self, photo): # noqa: F811
|
||||
# fixture found in test_photo
|
||||
input_media_photo = InputMediaPhoto(photo, caption="test 2")
|
||||
@@ -307,7 +309,8 @@ class TestInputMediaAnimationWithoutRequest(TestInputMediaAnimationBase):
|
||||
assert input_media_animation_dict["height"] == input_media_animation.height
|
||||
assert input_media_animation_dict["duration"] == input_media_animation.duration
|
||||
assert input_media_animation_dict["has_spoiler"] == input_media_animation.has_spoiler
|
||||
-
|
||||
+
|
||||
+ @pytest.mark.skip(reason="Requires internet connection")
|
||||
def test_with_animation(self, animation): # noqa: F811
|
||||
# fixture found in test_animation
|
||||
input_media_animation = InputMediaAnimation(animation, caption="test 2")
|
||||
@@ -375,7 +378,8 @@ class TestInputMediaAudioWithoutRequest(TestInputMediaAudioBase):
|
||||
assert input_media_audio_dict["caption_entities"] == [
|
||||
ce.to_dict() for ce in input_media_audio.caption_entities
|
||||
]
|
||||
-
|
||||
+
|
||||
+ @pytest.mark.skip(reason="Requires internet connection")
|
||||
def test_with_audio(self, audio): # noqa: F811
|
||||
# fixture found in test_audio
|
||||
input_media_audio = InputMediaAudio(audio, caption="test 3")
|
||||
@@ -447,6 +451,7 @@ class TestInputMediaDocumentWithoutRequest(TestInputMediaDocumentBase):
|
||||
== input_media_document.disable_content_type_detection
|
||||
)
|
||||
|
||||
+ @pytest.mark.skip(reason="Requires internet connection")
|
||||
def test_with_document(self, document): # noqa: F811
|
||||
# fixture found in test_document
|
||||
input_media_document = InputMediaDocument(document, caption="test 3")
|
||||
@@ -502,6 +507,7 @@ def media_group_no_caption_only_parse_mode(photo, thumb): # noqa: F811
|
||||
|
||||
|
||||
class TestSendMediaGroupWithoutRequest:
|
||||
+ @pytest.mark.skip(reason="Requires internet connection")
|
||||
async def test_send_media_group_throws_error_with_group_caption_and_individual_captions(
|
||||
self,
|
||||
bot,
|
||||
@@ -601,6 +607,7 @@ class CustomSequence(Sequence):
|
||||
|
||||
|
||||
class TestSendMediaGroupWithRequest:
|
||||
+ __test__ = False
|
||||
async def test_send_media_group_photo(self, bot, chat_id, media_group):
|
||||
messages = await bot.send_media_group(chat_id, media_group)
|
||||
assert isinstance(messages, tuple)
|
||||
diff --git a/tests/_files/test_photo.py b/tests/_files/test_photo.py
|
||||
index 9f85bec5..263eb933 100644
|
||||
--- a/tests/_files/test_photo.py
|
||||
+++ b/tests/_files/test_photo.py
|
||||
@@ -74,6 +74,7 @@ class TestPhotoBase:
|
||||
|
||||
|
||||
class TestPhotoWithoutRequest(TestPhotoBase):
|
||||
+ __test__ = False
|
||||
def test_slot_behaviour(self, photo):
|
||||
for attr in photo.__slots__:
|
||||
assert getattr(photo, attr, "err") != "err", f"got extra slot '{attr}'"
|
||||
@@ -211,6 +212,7 @@ class TestPhotoWithoutRequest(TestPhotoBase):
|
||||
|
||||
|
||||
class TestPhotoWithRequest(TestPhotoBase):
|
||||
+ __test__ = False
|
||||
async def test_send_photo_all_args(self, bot, chat_id, photo_file):
|
||||
message = await bot.send_photo(
|
||||
chat_id,
|
||||
diff --git a/tests/_files/test_sticker.py b/tests/_files/test_sticker.py
|
||||
index c8b9b02a..8c8c9c56 100644
|
||||
--- a/tests/_files/test_sticker.py
|
||||
+++ b/tests/_files/test_sticker.py
|
||||
@@ -115,6 +115,7 @@ class TestStickerBase:
|
||||
|
||||
|
||||
class TestStickerWithoutRequest(TestStickerBase):
|
||||
+ __test__ = False
|
||||
def test_slot_behaviour(self, sticker):
|
||||
for attr in sticker.__slots__:
|
||||
assert getattr(sticker, attr, "err") != "err", f"got extra slot '{attr}'"
|
||||
@@ -289,6 +290,7 @@ class TestStickerWithoutRequest(TestStickerBase):
|
||||
|
||||
|
||||
class TestStickerWithRequest(TestStickerBase):
|
||||
+ __test__ = False
|
||||
async def test_send_all_args(self, bot, chat_id, sticker_file, sticker):
|
||||
message = await bot.send_sticker(
|
||||
chat_id, sticker=sticker_file, disable_notification=False, protect_content=True
|
||||
@@ -526,6 +528,7 @@ class TestStickerSetBase:
|
||||
|
||||
|
||||
class TestStickerSetWithoutRequest(TestStickerSetBase):
|
||||
+ __test__ = False
|
||||
def test_slot_behaviour(self):
|
||||
inst = StickerSet("this", "is", True, self.stickers, True, "not")
|
||||
for attr in inst.__slots__:
|
||||
diff --git a/tests/_files/test_video.py b/tests/_files/test_video.py
|
||||
index b2ec1098..d181ffa0 100644
|
||||
--- a/tests/_files/test_video.py
|
||||
+++ b/tests/_files/test_video.py
|
||||
@@ -65,6 +65,7 @@ class TestVideoBase:
|
||||
|
||||
|
||||
class TestVideoWithoutRequest(TestVideoBase):
|
||||
+ __test__ = False
|
||||
def test_slot_behaviour(self, video):
|
||||
for attr in video.__slots__:
|
||||
assert getattr(video, attr, "err") != "err", f"got extra slot '{attr}'"
|
||||
@@ -203,6 +204,7 @@ class TestVideoWithoutRequest(TestVideoBase):
|
||||
|
||||
|
||||
class TestVideoWithRequest(TestVideoBase):
|
||||
+ __test__ = False
|
||||
async def test_send_all_args(self, bot, chat_id, video_file, video, thumb_file):
|
||||
message = await bot.send_video(
|
||||
chat_id,
|
||||
diff --git a/tests/_files/test_videonote.py b/tests/_files/test_videonote.py
|
||||
index b931678d..223f2541 100644
|
||||
--- a/tests/_files/test_videonote.py
|
||||
+++ b/tests/_files/test_videonote.py
|
||||
@@ -59,6 +59,7 @@ class TestVideoNoteBase:
|
||||
|
||||
|
||||
class TestVideoNoteWithoutRequest(TestVideoNoteBase):
|
||||
+ __test__ = False
|
||||
def test_slot_behaviour(self, video_note):
|
||||
for attr in video_note.__slots__:
|
||||
assert getattr(video_note, attr, "err") != "err", f"got extra slot '{attr}'"
|
||||
@@ -190,6 +191,7 @@ class TestVideoNoteWithoutRequest(TestVideoNoteBase):
|
||||
|
||||
|
||||
class TestVideoNoteWithRequest(TestVideoNoteBase):
|
||||
+ __test__ = False
|
||||
async def test_send_all_args(self, bot, chat_id, video_note_file, video_note, thumb_file):
|
||||
message = await bot.send_video_note(
|
||||
chat_id,
|
||||
diff --git a/tests/_files/test_voice.py b/tests/_files/test_voice.py
|
||||
index b29260d5..14cdbba7 100644
|
||||
--- a/tests/_files/test_voice.py
|
||||
+++ b/tests/_files/test_voice.py
|
||||
@@ -58,6 +58,7 @@ class TestVoiceBase:
|
||||
|
||||
|
||||
class TestVoiceWithoutRequest(TestVoiceBase):
|
||||
+ __test__ = False
|
||||
def test_slot_behaviour(self, voice):
|
||||
for attr in voice.__slots__:
|
||||
assert getattr(voice, attr, "err") != "err", f"got extra slot '{attr}'"
|
||||
@@ -177,6 +178,7 @@ class TestVoiceWithoutRequest(TestVoiceBase):
|
||||
|
||||
|
||||
class TestVoiceWithRequest(TestVoiceBase):
|
||||
+ __test__ = False
|
||||
async def test_send_all_args(self, bot, chat_id, voice_file, voice):
|
||||
message = await bot.send_voice(
|
||||
chat_id,
|
||||
diff --git a/tests/request/test_request.py b/tests/request/test_request.py
|
||||
index 9334f7b7..fd3672b9 100644
|
||||
--- a/tests/request/test_request.py
|
||||
+++ b/tests/request/test_request.py
|
||||
@@ -85,6 +85,7 @@ class TestNoSocksHTTP2WithoutRequest:
|
||||
|
||||
@pytest.mark.skipif(not TEST_WITH_OPT_DEPS, reason="Optional dependencies not installed")
|
||||
class TestHTTP2WithRequest:
|
||||
+ __test__ = False
|
||||
@pytest.mark.parametrize("http_version", ["2", "2.0"])
|
||||
async def test_http_2_response(self, http_version):
|
||||
httpx_request = HTTPXRequest(http_version=http_version)
|
||||
@@ -352,6 +353,7 @@ class TestRequestWithoutRequest:
|
||||
|
||||
@pytest.mark.skipif(not TEST_WITH_OPT_DEPS, reason="No need to run this twice")
|
||||
class TestHTTPXRequestWithoutRequest:
|
||||
+ __test__ = False
|
||||
test_flag = None
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
@@ -621,6 +623,7 @@ class TestHTTPXRequestWithoutRequest:
|
||||
|
||||
@pytest.mark.skipif(not TEST_WITH_OPT_DEPS, reason="No need to run this twice")
|
||||
class TestHTTPXRequestWithRequest:
|
||||
+ __test__ = False
|
||||
async def test_do_request_wait_for_pool(self, httpx_request):
|
||||
"""The pool logic is buried rather deeply in httpxcore, so we make actual requests here
|
||||
instead of mocking"""
|
||||
diff --git a/tests/test_bot.py b/tests/test_bot.py
|
||||
index d813d9f2..e580c68b 100644
|
||||
--- a/tests/test_bot.py
|
||||
+++ b/tests/test_bot.py
|
||||
@@ -196,6 +196,7 @@ class InputMessageContentDWPP(InputMessageContent):
|
||||
|
||||
|
||||
class TestBotWithoutRequest:
|
||||
+ __test__ = False
|
||||
"""
|
||||
Most are executed on tg.ext.ExtBot, as that class only extends the functionality of tg.bot
|
||||
|
||||
@@ -1791,6 +1792,7 @@ class TestBotWithoutRequest:
|
||||
|
||||
|
||||
class TestBotWithRequest:
|
||||
+ __test__ = False
|
||||
"""
|
||||
Most are executed on tg.ext.ExtBot, as that class only extends the functionality of tg.bot
|
||||
|
||||
diff --git a/tests/test_forum.py b/tests/test_forum.py
|
||||
index d367fc9c..17c5130a 100644
|
||||
--- a/tests/test_forum.py
|
||||
+++ b/tests/test_forum.py
|
||||
@@ -74,6 +74,7 @@ async def real_topic(bot, emoji_id, forum_group_id):
|
||||
|
||||
|
||||
class TestForumTopicWithoutRequest:
|
||||
+ __test__ = False
|
||||
def test_slot_behaviour(self, forum_topic_object):
|
||||
inst = forum_topic_object
|
||||
for attr in inst.__slots__:
|
||||
@@ -154,6 +155,7 @@ class TestForumTopicWithoutRequest:
|
||||
|
||||
|
||||
class TestForumMethodsWithRequest:
|
||||
+ __test__ = False
|
||||
async def test_create_forum_topic(self, real_topic):
|
||||
result = real_topic
|
||||
assert isinstance(result, ForumTopic)
|
||||
@@ -349,7 +351,8 @@ class TestForumTopicCreatedWithoutRequest:
|
||||
assert isinstance(action_dict, dict)
|
||||
assert action_dict["name"] == TEST_TOPIC_NAME
|
||||
assert action_dict["icon_color"] == TEST_TOPIC_ICON_COLOR
|
||||
-
|
||||
+
|
||||
+ @pytest.mark.skip(reason="Requires internet connection")
|
||||
def test_equality(self, emoji_id):
|
||||
a = ForumTopicCreated(name=TEST_TOPIC_NAME, icon_color=TEST_TOPIC_ICON_COLOR)
|
||||
b = ForumTopicCreated(
|
||||
@@ -0,0 +1,55 @@
|
||||
# Copyright 2023 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
DISTUTILS_USE_PEP517=setuptools
|
||||
PYTHON_COMPAT=( python3_{10..12} )
|
||||
inherit distutils-r1 optfeature
|
||||
|
||||
DESCRIPTION="Python wrapper of telegram bots API"
|
||||
HOMEPAGE="https://docs.python-telegram-bot.org https://github.com/python-telegram-bot/python-telegram-bot"
|
||||
SRC_URI="https://github.com/python-telegram-bot/python-telegram-bot/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
||||
|
||||
LICENSE="LGPL-3"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE=""
|
||||
|
||||
RDEPEND="
|
||||
>=dev-python/cachetools-5.3.0[${PYTHON_USEDEP}]
|
||||
>=dev-python/cryptography-39.0.1[${PYTHON_USEDEP}]
|
||||
>=dev-python/httpx-0.24.0[${PYTHON_USEDEP}]
|
||||
>=dev-python/tornado-6.2[${PYTHON_USEDEP}]
|
||||
dev-python/setuptools[${PYTHON_USEDEP}]
|
||||
"
|
||||
BDEPEND="
|
||||
test? (
|
||||
dev-python/beautifulsoup4[${PYTHON_USEDEP}]
|
||||
dev-python/flaky[${PYTHON_USEDEP}]
|
||||
dev-python/pytest[${PYTHON_USEDEP}]
|
||||
dev-python/pytest-asyncio[${PYTHON_USEDEP}]
|
||||
dev-python/pytz[${PYTHON_USEDEP}]
|
||||
>=dev-python/tornado-6.2[${PYTHON_USEDEP}]
|
||||
)
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/${P}-no-internet-tests.patch"
|
||||
)
|
||||
|
||||
distutils_enable_tests pytest
|
||||
|
||||
# Run only the tests that don't require a connection
|
||||
python_test() {
|
||||
epytest -m no_req
|
||||
}
|
||||
|
||||
python_prepare_all() {
|
||||
distutils-r1_python_prepare_all
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
optfeature_header "Optional package dependencies:"
|
||||
optfeature "using telegram.ext.JobQueue" dev-python/APScheduler
|
||||
}
|
||||
Reference in New Issue
Block a user