diff --git a/tests/conftest.py b/tests/conftest.py index b3e3244..ec042a1 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -10,6 +10,10 @@ def config(): 'kafka': { 'servers': ["localhost:9992"], 'topic': "sample", + 'cafile': "/dev/null", + 'cert': "/dev/null", + 'key': "/dev/null", + 'passwd': "", }, 'postgres': { 'dbhost': "localhost", @@ -34,6 +38,10 @@ def config_invalid(): 'kafka': { 'servers': ["localhost:9992"], 'topic': "sample", + 'cafile': "", + 'cert': "", + 'key': "", + 'passwd': "", }, 'postgres': { 'dbhost': "localhost", @@ -41,6 +49,7 @@ def config_invalid(): 'dbname': "chweb", 'dbuser': "vladan", 'dbpass': "", + 'dbcert': "", }, 'sites': [{ 'url': "https://dsadakjhkjsahkjh.com", diff --git a/tests/test_consumer.py b/tests/test_consumer.py index ed2f3d8..89712c8 100644 --- a/tests/test_consumer.py +++ b/tests/test_consumer.py @@ -1,13 +1,14 @@ import asyncio import aiokafka -from mock import Mock, AsyncMock +from mock import AsyncMock, Mock, patch import pytest from chweb.consumer import Consumer @pytest.mark.asyncio +@patch('ssl.SSLContext') async def test_consumer_called(check, config, event_loop): consumer = Consumer(config, Mock(), event_loop, Mock()) diff --git a/tests/test_producer.py b/tests/test_producer.py index 8150b99..f01bc11 100644 --- a/tests/test_producer.py +++ b/tests/test_producer.py @@ -1,13 +1,14 @@ import asyncio import aiokafka -from mock import Mock, AsyncMock +from mock import AsyncMock, Mock, patch import pytest from chweb.collector import Producer @pytest.mark.asyncio +@patch('ssl.SSLContext') async def test_producer_called(check, config, event_loop): queue = asyncio.Queue() producer = Producer(config, Mock(), event_loop, queue) @@ -23,6 +24,7 @@ async def test_producer_called(check, config, event_loop): @pytest.mark.asyncio +@patch('ssl.SSLContext') async def test_producer_called_invalid(config, event_loop): queue = asyncio.Queue() producer = Producer(config, Mock(), event_loop, queue)