-
Notifications
You must be signed in to change notification settings - Fork 35
Adding new exception:ArgusObjectNotFoundException #9
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
Thanks for the contribution! Before we can merge this, we need @rrajeevan to sign the Salesforce Contributor License Agreement. |
er...cla signed..try again |
argusclient/client.py
Outdated
@@ -741,7 +746,7 @@ def check_success(resp, decCls): | |||
raise ArgusException(resp.text) | |||
return res | |||
elif resp.status_code == httplib.NOT_FOUND: | |||
raise ArgusException("Object not found at endpoint: %s message: %s" % (resp.request.url, resp.text)) | |||
raise ArgusObjectNotFoundException("Object not found at endpoint: %s message: %s" % (resp.url, resp.text)) | |||
elif resp.status_code == httplib.UNAUTHORIZED: | |||
raise ArgusAuthException("Failed to authenticate at endpoint: %s message: %s" % (resp.request.url, resp.text)) |
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.
Could you change here also from resp.reqeust.url
to resp.url
for consistency sake?
@@ -423,18 +424,18 @@ def testGetUserAlert(self, mockGet): | |||
res = self.argus.alerts.get_user_alert(testId, testId) | |||
self.assertTrue(isinstance(res, Alert)) | |||
self.assertEquals(res.to_dict(), alert_D) | |||
self.assertIn((os.path.join(endpoint, "alerts"),), tuple(mockGet.call_args)) | |||
self.assertIn((os.path.join(endpoint, "alerts/meta"),), tuple(mockGet.call_args)) |
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.
Thanks for fixing this. This must have been me forgetting to run the unittests with my last change.
Thanks for the change, it looks good. If you could just do the one change above for consistency, I can go ahead and merge. |
@hdara-sfdc made the requested changes. Let me know what you think Added one more unit test
|
Nice! Have you already pushed it? I don't see it in the PR. |
Yeah.. You should see it below. Let me know if you cant. Squashed my commits :) |
OK, I didn't realize you squashed. Since github allows "Squash and merge" you don't have to do it, besides, squashing early makes it harder to review incrementally. I can see your changes and I will merge now. |
get_user_alert
Output of unit test: