Skip to content

Commit

Permalink
feat: added test_gssapi in test_security.py
Browse files Browse the repository at this point in the history
  • Loading branch information
roma-frolov committed Aug 1, 2024
1 parent 609601f commit 7ede80b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 38 deletions.
38 changes: 0 additions & 38 deletions tests/brokers/kafka/test_security.py

This file was deleted.

21 changes: 21 additions & 0 deletions tests/docs/kafka/test_security.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,24 @@ async def test_plaintext():
assert call_kwargs.items() <= producer_call_kwargs.items()

assert type(producer_call_kwargs["ssl_context"]) is ssl.SSLContext


@pytest.mark.kafka()
@pytest.mark.asyncio()
async def test_gssapi():
from docs.docs_src.kafka.security.sasl_gssapi import (
broker as gssapi_broker,
)

with patch_aio_consumer_and_producer() as producer:
async with gssapi_broker:
producer_call_kwargs = producer.call_args.kwargs

call_kwargs = {
"sasl_mechanism": "GSSAPI",
"security_protocol": "SASL_SSL",
}

assert call_kwargs.items() <= producer_call_kwargs.items()

assert type(producer_call_kwargs["ssl_context"]) is ssl.SSLContext

0 comments on commit 7ede80b

Please sign in to comment.