mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Backport text decorations. Improve timeouts in tests. Improve TelegramAPIServer
This commit is contained in:
parent
4292b3934f
commit
1a185928a2
11 changed files with 82 additions and 48 deletions
|
|
@ -1,4 +1,4 @@
|
|||
from aiogram.client.telegram import PRODUCTION
|
||||
from aiogram.client.telegram import PRODUCTION, TelegramAPIServer
|
||||
|
||||
|
||||
class TestAPIServer:
|
||||
|
|
@ -9,3 +9,13 @@ class TestAPIServer:
|
|||
def test_file_url(self):
|
||||
file_url = PRODUCTION.file_url(token="42:TEST", path="path")
|
||||
assert file_url == "https://api.telegram.org/file/bot42:TEST/path"
|
||||
|
||||
def test_from_base(self):
|
||||
local_server = TelegramAPIServer.from_base("http://localhost:8081", is_local=True)
|
||||
|
||||
method_url = local_server.api_url("42:TEST", method="apiMethod")
|
||||
file_url = local_server.file_url(token="42:TEST", path="path")
|
||||
|
||||
assert method_url == "http://localhost:8081/bot42:TEST/apiMethod"
|
||||
assert file_url == "http://localhost:8081/file/bot42:TEST/path"
|
||||
assert local_server.is_local
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue