mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-09 01:15:31 +00:00
No cover if TYPE_CHECKING
This commit is contained in:
parent
c9e490bcee
commit
0acdb24c3c
60 changed files with 60 additions and 100 deletions
|
|
@ -1,9 +1,6 @@
|
|||
import datetime
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
import pytz
|
||||
from asynctest import CoroutineMock
|
||||
|
||||
from aiogram.api.client.session.base import BaseSession
|
||||
from aiogram.api.client.telegram import PRODUCTION, TelegramAPIServer
|
||||
|
|
@ -31,25 +28,6 @@ class TestBaseSession(DataMixin):
|
|||
session = BaseSession(api=api)
|
||||
assert session.api == api
|
||||
|
||||
def test_sync_close(self):
|
||||
session = BaseSession()
|
||||
|
||||
with patch(
|
||||
"aiogram.api.client.session.base.BaseSession.close", new=CoroutineMock()
|
||||
) as mocked_close:
|
||||
session.__del__()
|
||||
mocked_close.assert_called_once_with()
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_async_close(self):
|
||||
session = BaseSession()
|
||||
|
||||
with patch(
|
||||
"aiogram.api.client.session.base.BaseSession.close", new=CoroutineMock()
|
||||
) as mocked_close:
|
||||
session.__del__()
|
||||
mocked_close.assert_called_once()
|
||||
|
||||
def test_prepare_value(self):
|
||||
session = BaseSession()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue