-
Notifications
You must be signed in to change notification settings - Fork 71
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
Stop the iterator for empty responses and do not process ERROR responses #22
Conversation
Codecov Report
@@ Coverage Diff @@
## master #22 +/- ##
==========================================
+ Coverage 92.53% 92.77% +0.24%
==========================================
Files 14 14
Lines 898 914 +16
==========================================
+ Hits 831 848 +17
+ Misses 67 66 -1
Continue to review full report at Codecov.
|
befcc02
to
d956bc4
Compare
d956bc4
to
871e42a
Compare
In case you accept this PR, can you please release a new version on PyPI? |
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.
Thank you!
cnt = 0 | ||
async for _ in watch.stream(fake_api.get_namespaces): | ||
cnt += 1 | ||
assert cnt == len(side_effects) |
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.
self.assertEqual
will be better here, it produces more meaningful errors.
} | ||
|
||
ret = Watch().unmarshal_event(json.dumps(k8s_err), None) | ||
assert ret['type'] == k8s_err['type'] |
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.
Consider using assertEqual
...
Latest release 1.0.0a4 has these changes, thanks again. |
This PR solves two problems I encountered:
StopIteration
for empty K8s responses (eg when the timeout expires).