This repository has been archived on 2020-09-24. You can view files and clone it, but cannot push or open issues or pull requests.
producer/integtest.py

35 lines
1.1 KiB
Python
Raw Normal View History

2020-05-08 19:13:00 +02:00
#!/usr/bin/env python
"""
Integration test for the producer module.
"""
2020-05-08 19:21:38 +02:00
import os
from communicator import Communicator
from consumerlocator import ConsumerLocator
from messagesender import MessageSender
from redisconnector import RedisConnector
2020-05-08 19:13:00 +02:00
from pytest_redis import factories
__author__ = "@dscharnitzky"
__copyright__ = "Copyright 2020, GoldenPogácsa Team"
__module_name__ = "integtest"
__version__text__ = "1"
generateduuid = '2fbff1f2-27e7-44c8-88d9-7348cee8c1c3'
redis_proc = factories.redis_proc(host='cache', port=6379)
redis_db = factories.redisdb('redis_nooproc')
2020-05-08 19:21:38 +02:00
KNOWNCONSUMER = os.getenv("PRODUCER_KNOWNCONSUMER", '10.69.42.1')
2020-05-08 19:13:00 +02:00
def test_integration(mocker):
"""
Tests the whole system.
:param mocker: patches the :class:`communicator.Communicator`.
"""
2020-05-08 19:21:38 +02:00
communicator = Communicator(currentconsumer=KNOWNCONSUMER, uuid=generateduuid)
messagesender = MessageSender(communicator=communicator, uuid=generateduuid)
consumerlocator = ConsumerLocator(uuid=generateduuid, communicator=communicator,
redisconnector=RedisConnector())