mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Backport and improvements (#601)
* Backport RedisStorage, deep-linking * Allow prereleases for aioredis * Bump dependencies * Correctly skip Redis tests on Windows * Reformat tests code and bump Makefile
This commit is contained in:
parent
32bc05130f
commit
83d6ab48c5
43 changed files with 1004 additions and 327 deletions
24
tests/test_utils/test_link.py
Normal file
24
tests/test_utils/test_link.py
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
from typing import Any, Dict
|
||||
|
||||
import pytest
|
||||
|
||||
from aiogram.utils.link import create_telegram_link, create_tg_link
|
||||
|
||||
|
||||
class TestLink:
|
||||
@pytest.mark.parametrize(
|
||||
"base,params,result",
|
||||
[["user", dict(id=42), "tg://user?id=42"]],
|
||||
)
|
||||
def test_create_tg_link(self, base: str, params: Dict[str, Any], result: str):
|
||||
assert create_tg_link(base, **params) == result
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"base,params,result",
|
||||
[
|
||||
["username", dict(), "https://t.me/username"],
|
||||
["username", dict(start="test"), "https://t.me/username?start=test"],
|
||||
],
|
||||
)
|
||||
def test_create_telegram_link(self, base: str, params: Dict[str, Any], result: str):
|
||||
assert create_telegram_link(base, **params) == result
|
||||
Loading…
Add table
Add a link
Reference in a new issue