-
Notifications
You must be signed in to change notification settings - Fork 69
Fix EnqueueTimeUtc in EventHub and expose ServiceBus new properties #65
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
"MethodName": "ServiceBusSMany", | ||
"UtcNow": "2020-06-18T05:39:12.2860411Z", | ||
"RandGuid": "bb38deae-cc75-49f2-89f5-96ec6eb857db" | ||
mocked_metadata['MessageReceiver'] = meta.Datum(type='json', value=''' |
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 the new section of metadata received?
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.
Yes, this is the new section of metadata provided by the extension. We still support the old mocked_metadata['sys'] in line 192.
# Datetime should be in iso8601 string instead of datetime object | ||
metadata_dict = servicebus_msg.metadata | ||
self.assertDictEqual(metadata_dict, { | ||
self.assertGreaterEqual(metadata_dict.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.
Does this compare all the metadata items? If yes, then why the "Greater"?
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 test is amended to ensure the metadata_dict has the following expected fields (DeliveryCount, LockToken, ExpiresAtUtc...).
Using self.assertDictEqual is too strict for this test scenario. We just want to ensure the expected fields are a subset of the metadata, no need to be identical. I tried using self.assertDictContainsSubset but it has been deprecated in Python 3.6. So I first convert the dictionary into an ItemView (an item set) using .items(), and use self.assertGreaterEqual for subset check.
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.
LGTM! 🚢
Descriptions
trigger_metadata['EnqueuedTimeUtc']
instead oftrigger_metadata['EnqueuedTime']
.