-
Notifications
You must be signed in to change notification settings - Fork 1k
Support webhook setting APIs #300
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
|
Hi @CA-Lee, Thanks for your contribution.🙂 |
|
Thanks for instantly replying, test cases were added, and CI has passed. |
|
Please fix the comments. If you have any questions, we could discuss the comments. |
|
Excuse me, where the comments are...? I didn't see any comment in "files changed" tab. |
linebot/api.py
Outdated
| timeout=timeout, | ||
| ) | ||
|
|
||
| return response.json |
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.
You need to return Webhook model, like this
linebot/api.py
Outdated
| timeout=timeout, | ||
| ) | ||
|
|
||
| return response.json |
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.
You need to return Webhook model, like this
| self.assertEqual(webhook['endpoint'], 'https://example.herokuapp.com/test') | ||
| self.assertEqual(webhook['active'], 'true') |
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.
If you have Webhookmodel, the assert function would likeassertEqual(webhook.endpoint, 'http://...')`.
You can reference this
| self.assertEqual(result['success'], 'true') | ||
| self.assertEqual(result['timestamp'], '2020-09-30T05:38:20.031Z') | ||
| self.assertEqual(result['statusCode'], 200) | ||
| self.assertEqual(result['reason'], 'OK') | ||
| self.assertEqual(result['detail'], '200') |
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.
You need a TestWebhook model
@CA-Lee sorry I forgot to push the review comment |
|
OK, I'm working on it |
|
All comments are fixed, CI has passed, too. I'll update the README.rst later. |
|
README.rst was updated, the commit's timestamp is wrong due to my computer problem. Thanks for your patiently read & reply. |
louis70109
left a comment
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
|
Could you please to label this PR as |
|
Hi @CA-Lee ,
Thanks in advance. |
|
Done. :) |
Dear Maintainers,
This PR implemented the following three APIs of webhook settings, which were also mentioned in #298 .
This is my first PR on this repository, tell me if I miss something. Also, if you please, label this PR as
hacktoberfest-accepted.