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:
Alex Root Junior 2021-06-15 01:45:31 +03:00 committed by GitHub
parent 32bc05130f
commit 83d6ab48c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
43 changed files with 1004 additions and 327 deletions

View 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