Skip to content

Commit

Permalink
update tests for kafka_handler.py
Browse files Browse the repository at this point in the history
  • Loading branch information
lamr02n committed Jun 12, 2024
1 parent 1800ffc commit 2558af5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion heidgaf_core/kafka_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class KafkaMessageFetchException(Exception):
pass


# TODO: Test
class KafkaHandler:
def __init__(self):
self.consumer = None
Expand All @@ -32,6 +31,7 @@ def __init__(self):
)


# TODO: Test
class KafkaProduceHandler(KafkaHandler):
def __init__(self):
super().__init__()
Expand Down
16 changes: 16 additions & 0 deletions tests/test_kafka_handler.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import unittest

from heidgaf_core.kafka_handler import KafkaHandler


class TestInit(unittest.TestCase):
def test_init(self):
handler_instance = KafkaHandler()

self.assertIsNone(handler_instance.consumer)
self.assertEqual("localhost:9092,localhost:9093,localhost:9094",
handler_instance.brokers)


if __name__ == '__main__':
unittest.main()

0 comments on commit 2558af5

Please sign in to comment.