Remove one of the tests

This commit is contained in:
Roman Mogylatov 2020-08-05 21:51:41 -04:00
parent e6c9181fc5
commit 17d0de282b

View File

@ -9,7 +9,16 @@ import pytest
from .containers import ApplicationContainer
CONFIG = {
@dataclasses.dataclass
class RequestStub:
status: int
content_length: int
@pytest.fixture
def container():
container = ApplicationContainer()
container.config.from_dict({
'log': {
'level': 'INFO',
'formant': '[%(asctime)s] [%(levelname)s] [%(name)s]: %(message)s',
@ -28,19 +37,7 @@ CONFIG = {
'check_every': 1,
},
},
}
@dataclasses.dataclass
class RequestStub:
status: int
content_length: int
@pytest.fixture
def container():
container = ApplicationContainer()
container.config.from_dict(CONFIG)
})
return container
@ -63,25 +60,6 @@ async def test_example_monitor(container, caplog):
assert 'content length: 635' in caplog.text
@pytest.mark.asyncio
async def test_httpbin_monitor(container, caplog):
caplog.set_level('INFO')
http_client_mock = mock.AsyncMock()
http_client_mock.request.return_value = RequestStub(
status=200,
content_length=482,
)
with container.http_client.override(http_client_mock):
httpbin_monitor = container.httpbin_monitor()
await httpbin_monitor.check()
assert 'http://fake-httpbin.org/get' in caplog.text
assert 'Response code: 200' in caplog.text
assert 'content length: 482' in caplog.text
@pytest.mark.asyncio
async def test_dispatcher(container, caplog, event_loop):
caplog.set_level('INFO')