Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Updated 3 failing tests of test_message.py. #4431

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions tests/test_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
from tests.auxil.slots import mro_slots


@pytest.fixture(scope="module")
@pytest.fixture
def message(bot):
message = PytestMessage(
message_id=TestMessageBase.id_,
Expand Down Expand Up @@ -1193,16 +1193,20 @@ def test_link_with_id(self, message, type_, id_):
# The leading - for group ids/ -100 for supergroup ids isn't supposed to be in the link
assert message.link == f"https://t.me/c/{3}/{message.message_id}"

def test_link_with_topics(self, message):
@pytest.mark.parametrize("type_", argvalues=[Chat.SUPERGROUP, Chat.CHANNEL])
def test_link_with_topics(self, message, type_):
message.chat.username = None
message.chat.id = -1003
message.chat.type = type_
message.is_topic_message = True
message.message_thread_id = 123
assert message.link == f"https://t.me/c/3/{message.message_id}?thread=123"

def test_link_with_reply(self, message):
@pytest.mark.parametrize("type_", argvalues=[Chat.SUPERGROUP, Chat.CHANNEL])
def test_link_with_reply(self, message, type_):
message.chat.username = None
message.chat.id = -1003
message.chat.type = type_
message.reply_to_message = Message(7, self.from_user, self.date, self.chat, text="Reply")
message.message_thread_id = 123
assert message.link == f"https://t.me/c/3/{message.message_id}?thread=123"
Expand Down