Skip to content

Commit

Permalink
tests/admin: allow omitted namespace in NamespacedTopic
Browse files Browse the repository at this point in the history
  • Loading branch information
bashtanov committed Sep 16, 2024
1 parent a2291fc commit a273fc7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/rptest/services/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,15 @@ def from_response(cls, rsp: Response):


class NamespacedTopic:
def __init__(self, topic: str, namespace: str = "kafka"):
def __init__(self, topic: str, namespace: str | None = "kafka"):
self.ns = namespace
self.topic = topic

def as_dict(self):
return {'ns': self.ns, 'topic': self.topic}
ret = {'topic': self.topic}
if self.ns is not None:
ret['ns'] = self.ns
return ret

@classmethod
def from_json(cls, body: bytes):
Expand Down

0 comments on commit a273fc7

Please sign in to comment.