Add some missing words in the docs

This commit is contained in:
Lonami Exo 2020-01-19 13:25:58 +01:00
parent 72dc8052b3
commit da9505fa3c
6 changed files with 26 additions and 1 deletions

View File

@ -88,6 +88,7 @@ Downloads
download_media download_media
download_profile_photo download_profile_photo
download_file download_file
iter_download
Dialogs Dialogs
------- -------
@ -130,6 +131,7 @@ Chats
iter_participants iter_participants
get_participants get_participants
kick_participant
iter_admin_log iter_admin_log
get_admin_log get_admin_log
iter_profile_photos iter_profile_photos

View File

@ -35,7 +35,8 @@ class ButtonMethods:
from telethon import Button from telethon import Button
markup = client.build_reply_markup(Button.inline('hi')) markup = client.build_reply_markup(Button.inline('hi'))
await client.send_message('click me', buttons=markup) # later
await client.send_message(chat, 'click me', buttons=markup)
""" """
if buttons is None: if buttons is None:
return None return None

View File

View File

@ -0,0 +1,8 @@
import pathlib
import pytest
@pytest.fixture
def docs_dir():
return pathlib.Path('readthedocs')

View File

@ -0,0 +1,14 @@
import re
from telethon import TelegramClient
def test_all_methods_present(docs_dir):
with (docs_dir / 'quick-references/client-reference.rst').open(encoding='utf-8') as fd:
present_methods = set(map(str.lstrip, re.findall(r'^ {4}\w+$', fd.read(), re.MULTILINE)))
assert len(present_methods) > 0
for name in dir(TelegramClient):
attr = getattr(TelegramClient, name)
if callable(attr) and not name.startswith('_'):
assert name in present_methods