diff options
author | Asif Saif Uddin <auvipy@gmail.com> | 2023-04-08 22:45:08 +0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-08 22:45:08 +0600 |
commit | 973dc3790ac25b9da7b6d2641ac72d95470f6ed8 (patch) | |
tree | 9e7ba02d8520994a06efc37dde05fba722138189 /t/integration/test_kafka.py | |
parent | 7ceb675bb69917fae182ebdaf9a2298a308c3fa4 (diff) | |
parent | 2de7f9f038dd62e097e490cb3fa609067c1c3c36 (diff) | |
download | kombu-py310.tar.gz |
Merge branch 'main' into py310py310
Diffstat (limited to 't/integration/test_kafka.py')
-rw-r--r-- | t/integration/test_kafka.py | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/t/integration/test_kafka.py b/t/integration/test_kafka.py new file mode 100644 index 00000000..2303d887 --- /dev/null +++ b/t/integration/test_kafka.py @@ -0,0 +1,69 @@ +from __future__ import annotations + +import pytest + +import kombu + +from .common import (BaseExchangeTypes, BaseFailover, BaseMessage, + BasicFunctionality) + + +def get_connection(hostname, port): + return kombu.Connection( + f'confluentkafka://{hostname}:{port}', + ) + + +def get_failover_connection(hostname, port): + return kombu.Connection( + f'confluentkafka://localhost:12345;confluentkafka://{hostname}:{port}', + connect_timeout=10, + ) + + +@pytest.fixture() +def invalid_connection(): + return kombu.Connection('confluentkafka://localhost:12345') + + +@pytest.fixture() +def connection(): + return get_connection( + hostname='localhost', + port='9092' + ) + + +@pytest.fixture() +def failover_connection(): + return get_failover_connection( + hostname='localhost', + port='9092' + ) + + +@pytest.mark.env('kafka') +@pytest.mark.flaky(reruns=5, reruns_delay=2) +class test_KafkaBasicFunctionality(BasicFunctionality): + pass + + +@pytest.mark.env('kafka') +@pytest.mark.flaky(reruns=5, reruns_delay=2) +class test_KafkaBaseExchangeTypes(BaseExchangeTypes): + + @pytest.mark.skip('fanout is not implemented') + def test_fanout(self, connection): + pass + + +@pytest.mark.env('kafka') +@pytest.mark.flaky(reruns=5, reruns_delay=2) +class test_KafkaFailover(BaseFailover): + pass + + +@pytest.mark.env('kafka') +@pytest.mark.flaky(reruns=5, reruns_delay=2) +class test_KafkaMessage(BaseMessage): + pass |