File: test_client_reference.py

package info (click to toggle)
python-telethon 1.42.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,520 kB
  • sloc: python: 16,285; javascript: 200; makefile: 16; sh: 11
file content (14 lines) | stat: -rw-r--r-- 519 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
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('_') and name != 'sign_up':
            assert name in present_methods