Skip to content

Commit

Permalink
fix unittests
Browse files Browse the repository at this point in the history
  • Loading branch information
dferrochio committed May 16, 2024
1 parent aaccb96 commit 3df70cd
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from confluent_kafka import Consumer, Producer

from typing import Optional

class MockConsumer(Consumer):
def __init__(self, queue, config):
Expand All @@ -20,11 +20,21 @@ def poll(self, timeout=None):


class MockedMessage:
def __init__(self, topic: str, partition: int, offset: int, headers, key=None, value=None):
def __init__(
self,
topic: str,
partition: int,
offset: int,
headers,
key: Optional[str]=None,
value=Optional[str]=None
):
self._topic = topic
self._partition = partition
self._offset = offset
self._headers = headers
self._key = key
self._value = value

def topic(self):
return self._topic
Expand Down

0 comments on commit 3df70cd

Please sign in to comment.