Skip to content

Commit

Permalink
sort the sample eventwebhook payload keys
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Harrison committed Jun 11, 2020
1 parent 71fc35c commit 7075591
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: venv install test-install test test-integ test-docker clean nopyc

venv:
venv: clean
@python --version || (echo "Python is not installed, please install Python 2 or Python 3"; exit 1);
virtualenv --python=python venv

Expand Down
6 changes: 4 additions & 2 deletions sendgrid/helpers/eventwebhook/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
from ellipticcurve.ecdsa import Ecdsa
from ellipticcurve.signature import Signature
from ellipticcurve.publicKey import PublicKey
from ellipticcurve.signature import Signature

class EventWebhook():

class EventWebhook:
"""
This class allows you to use the Event Webhook feature. Read the docs for
more details: https://sendgrid.com/docs/for-developers/tracking-events/event
"""

def __init__(self, public_key=None):
"""
Construct the Event Webhook verifier object
Expand Down
3 changes: 2 additions & 1 deletion test/test_eventwebhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@

from sendgrid import EventWebhook


class UnitTests(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.PUBLIC_KEY = 'MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEEDr2LjtURuePQzplybdC+u4CwrqDqBaWjcMMsTbhdbcwHBcepxo7yAQGhHPTnlvFYPAZFceEu/1FwCM/QmGUhA=='
cls.SIGNATURE = 'MEUCIQCtIHJeH93Y+qpYeWrySphQgpNGNr/U+UyUlBkU6n7RAwIgJTz2C+8a8xonZGi6BpSzoQsbVRamr2nlxFDWYNH2j/0='
cls.TIMESTAMP = '1588788367'
cls.PAYLOAD = json.dumps({
'event': 'test_event',
'category': 'example_payload',
'event': 'test_event',
'message_id': 'message_id',
}, separators=(',', ':'))

Expand Down

0 comments on commit 7075591

Please sign in to comment.