-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Topic subscriber models #451
Changes from 4 commits
2485e60
ffa611c
700afe7
68bd0d2
0c28f37
1291f11
d378535
99fc978
c0c19d7
43b1f6f
caa6a86
ffc3d89
8c9fc38
b681da1
3457dd5
8de4885
026bba3
7de573a
4662a55
f415f4b
60b7369
cac2a00
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,8 @@ | |
Resolvable, | ||
Runner, | ||
System, | ||
Subscriber, | ||
TopicSubscribers, | ||
) | ||
|
||
|
||
|
@@ -903,3 +905,22 @@ def resolvable_chunk_dict(): | |
@pytest.fixture | ||
def bg_resolvable_chunk(resolvable_chunk_dict): | ||
return Resolvable(**resolvable_chunk_dict) | ||
|
||
|
||
@pytest.fixture | ||
def subscriber_dict(): | ||
"""Subscribers as a dictionary.""" | ||
return { | ||
"garden": "garden", | ||
"namespace": "ns", | ||
"system": "system", | ||
"version": "1.0.0", | ||
"instance": None, | ||
"command": None, | ||
} | ||
|
||
|
||
@pytest.fixture | ||
def topic_subscriber_dict(subscriber_dict): | ||
"""Topic subscribers as dict""" | ||
return {"topic": "foo", "subscribers": [subscriber_dict]} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need both the dict and bg_models for these objects. That way it can also be evaluated in the test/schema_parser_test.py There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. Added tests in test/schema_parser_test.py. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Purely a style comment, in our other models if there is a list, we set the default to None. Then on the assign we do:
self.subscribers = subscribers or []
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed