mirror of
https://github.com/Telecominfraproject/wlan-testing.git
synced 2025-12-24 22:47:08 +00:00
healthcheck method modified to ap event test
Signed-off-by: anil-tegala <anil.tegala@candelatech.com>
This commit is contained in:
@@ -8,20 +8,20 @@ import pytest
|
||||
@allure.feature("Test Kafka Messages")
|
||||
@allure.title("Real Time AP Events")
|
||||
@pytest.mark.ap_events
|
||||
class TestKafkaEvents(object):
|
||||
class TestKafkaApEvents(object):
|
||||
# Pytest unit test for validating Kafka healthcheck messages
|
||||
@allure.title("Test HealthCheck Messages")
|
||||
@pytest.mark.health_check
|
||||
def test_kafka_healthcheck(self, kafka_consumer_healthcheck):
|
||||
@allure.title("Test AP events")
|
||||
@pytest.mark.ap_events
|
||||
def test_kafka_ap_event(self, kafka_consumer_deq):
|
||||
# Consume messages and validate them
|
||||
for message in kafka_consumer_healthcheck:
|
||||
for event in kafka_consumer_deq:
|
||||
# Apply validation logic on message value
|
||||
print(message)
|
||||
print("%s:%d:%d: key=%s value=%s" % (message.topic, message.partition,
|
||||
message.offset, message.key,
|
||||
message.value))
|
||||
if message.value is not None:
|
||||
allure.attach(name="Kafka Health Check Message Info", body=str(message.value))
|
||||
print(event)
|
||||
print("%s:%d:%d: key=%s value=%s" % (event.topic, event.partition,
|
||||
event.offset, event.key,
|
||||
event.value))
|
||||
if event.value is not None:
|
||||
allure.attach(name="Kafka AP Event Info", body=str(event.value))
|
||||
break
|
||||
|
||||
# Assert that the message is valid
|
||||
|
||||
Reference in New Issue
Block a user