MCPcopy Index your code
hub / github.com/python-telegram-bot/python-telegram-bot / PollTestBase

Class PollTestBase

tests/test_poll.py:493–523  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

491
492
493class PollTestBase:
494 id_ = "id"
495 question = "Test Question?"
496 options = [
497 PollOption("test", 10, persistent_id="persistent_id"),
498 PollOption("test2", 11, persistent_id="persistent_id_2"),
499 ]
500 total_voter_count = 0
501 is_closed = True
502 is_anonymous = False
503 type = Poll.REGULAR
504 allows_multiple_answers = True
505 members_only = True
506 explanation = (
507 b"\\U0001f469\\u200d\\U0001f469\\u200d\\U0001f467"
508 b"\\u200d\\U0001f467\\U0001f431http://google.com"
509 ).decode("unicode-escape")
510 explanation_entities = [MessageEntity(13, 17, MessageEntity.URL)]
511 open_period = dtm.timedelta(seconds=42)
512 close_date = dtm.datetime.now(dtm.timezone.utc)
513 question_entities = [
514 MessageEntity(MessageEntity.BOLD, 0, 4),
515 MessageEntity(MessageEntity.ITALIC, 5, 8),
516 ]
517 allows_revoting = True
518 correct_option_ids = [1, 2]
519 description = "description"
520 description_entities = [MessageEntity(MessageEntity.ITALIC, 0, 11)]
521 country_codes = ["AB", "CD"]
522 media = PollMedia(document=Document("file_id", "file_unique_id", "file_name", 42))
523 explanation_media = PollMedia(animation=Animation("blah", "unique_id", 320, 180, 1))
524
525
526class TestPollWithoutRequest(PollTestBase):

Callers

nothing calls this directly

Calls 5

PollOptionClass · 0.90
MessageEntityClass · 0.90
PollMediaClass · 0.90
DocumentClass · 0.90
AnimationClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…