Add token validation util, fix deepcopy of sessions and make bot hashable and comparable

This commit is contained in:
Alex Root Junior 2019-11-28 23:12:44 +02:00
parent 9adc2f91bd
commit c674b5547b
11 changed files with 223 additions and 41 deletions

View file

@ -3,9 +3,9 @@ from aiogram.api.client.telegram import PRODUCTION
class TestAPIServer:
def test_method_url(self):
method_url = PRODUCTION.api_url(token="TOKEN", method="apiMethod")
assert method_url == "https://api.telegram.org/botTOKEN/apiMethod"
method_url = PRODUCTION.api_url(token="42:TEST", method="apiMethod")
assert method_url == "https://api.telegram.org/bot42:TEST/apiMethod"
def test_file_url(self):
file_url = PRODUCTION.file_url(token="TOKEN", path="path")
assert file_url == "https://api.telegram.org/file/botTOKEN/path"
file_url = PRODUCTION.file_url(token="42:TEST", path="path")
assert file_url == "https://api.telegram.org/file/bot42:TEST/path"