-
Notifications
You must be signed in to change notification settings - Fork 58
Consolidating return types #7
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
Conversation
30ec126
to
043236b
Compare
Signed-off-by: Denis Makogon <denys.makogon@oracle.com>
- this method validates whether a converter can process the event, in case of structured converter this method does nothing, in case of binary converter this method raise an exception if an event is not v0.2 - adding (un)marshaller validation on being a callable object - tests added Signed-off-by: Denis Makogon <denys.makogon@oracle.com>
@@ -25,6 +25,13 @@ class BinaryHTTPCloudEventConverter(base.Converter): | |||
TYPE = "binary" | |||
SUPPORTED_VERSIONS = [v02.Event, ] |
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.
Binary format was specified in v0.1 as well:
https://github.com/cloudevents/spec/blob/v0.1/http-transport-binding.md#31-binary-content-mode
Signed-off-by: Evan Anderson <argent@google.com>
|
||
content_type = headers.get( | ||
"content-type", headers.get("Content-Type")) | ||
|
||
for _, cnvrtr in self.__converters.items(): |
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.
This is treating self.__converters
as an unordered list (despite having been passed as an ordered list on line 102. dict
randomization will mean that binary mode will sometimes be selected for a structured-mode request, which will cause test flakiness. (Discovered this by accident when re-running tests after fixing a lint error.)
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.
(I fixed this in #9)
Signed-off-by: Evan Anderson <argent@google.com>
Closes: #6
Closes: #4