Format code with black, autopep8 and isort

This commit fixes the style issues introduced in dd50a9b according to the output
from black, autopep8 and isort.

Details: 4e472085-2e87-4f61-b7a1-ed208506962f/
This commit is contained in:
deepsource-autofix[bot] 2020-11-08 21:49:34 +00:00 committed by GitHub
parent dd50a9b13e
commit af4ceef153
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 1214 additions and 720 deletions

View file

@ -3,13 +3,13 @@ import pytest
from aiogram.bot.api import check_token
from aiogram.utils.exceptions import ValidationError
VALID_TOKEN = '123456789:AABBCCDDEEFFaabbccddeeff-1234567890'
VALID_TOKEN = "123456789:AABBCCDDEEFFaabbccddeeff-1234567890"
INVALID_TOKENS = [
'123456789:AABBCCDDEEFFaabbccddeeff 123456789', # space is exists
'ABC:AABBCCDDEEFFaabbccddeeff123456789', # left part is not digit
':AABBCCDDEEFFaabbccddeeff123456789', # there is no left part
'123456789:', # there is no right part
'ABC AABBCCDDEEFFaabbccddeeff123456789', # there is no ':' separator
"123456789:AABBCCDDEEFFaabbccddeeff 123456789", # space is exists
"ABC:AABBCCDDEEFFaabbccddeeff123456789", # left part is not digit
":AABBCCDDEEFFaabbccddeeff123456789", # there is no left part
"123456789:", # there is no right part
"ABC AABBCCDDEEFFaabbccddeeff123456789", # there is no ':' separator
None, # is None
12345678, # is digit
{}, # is dict
@ -17,13 +17,12 @@ INVALID_TOKENS = [
]
@pytest.fixture(params=INVALID_TOKENS, name='invalid_token')
@pytest.fixture(params=INVALID_TOKENS, name="invalid_token")
def invalid_token_fixture(request):
return request.param
class TestCheckToken:
def test_valid(self):
if check_token(VALID_TOKEN) is not True:
raise AssertionError

View file

@ -38,7 +38,11 @@ class TestAiohttpSession:
@pytest.mark.asyncio
async def test_create_proxy_bot(self):
socks_ver, host, port, username, password = (
"socks5", "124.90.90.90", 9999, "login", "password"
"socks5",
"124.90.90.90",
9999,
"login",
"password",
)
bot = BaseBot(
@ -65,7 +69,9 @@ class TestAiohttpSession:
@pytest.mark.asyncio
async def test_close_session(self):
bot = BaseBot(token="42:correct",)
bot = BaseBot(
token="42:correct",
)
aiohttp_client_0 = bot.session
with patch("aiohttp.ClientSession.close", new=CoroutineMock()) as mocked_close: