diff --git a/Makefile b/Makefile index fe7f18e97..356d46682 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/sendgrid/helpers/eventwebhook/__init__.py b/sendgrid/helpers/eventwebhook/__init__.py index e6aafb708..5bb7174f8 100644 --- a/sendgrid/helpers/eventwebhook/__init__.py +++ b/sendgrid/helpers/eventwebhook/__init__.py @@ -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 diff --git a/test/test_eventwebhook.py b/test/test_eventwebhook.py index 66a26700b..01c8129f1 100644 --- a/test/test_eventwebhook.py +++ b/test/test_eventwebhook.py @@ -3,6 +3,7 @@ from sendgrid import EventWebhook + class UnitTests(unittest.TestCase): @classmethod def setUpClass(cls): @@ -10,8 +11,8 @@ def setUpClass(cls): 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=(',', ':'))