Skip to content
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

Add tests for sendgrid.py apikey and api_key setters #425

Merged
merged 1 commit into from
Oct 28, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions test/test_sendgrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,20 @@ def test_apikey_init(self):
my_sendgrid = sendgrid.SendGridAPIClient(apikey="THISISMYKEY")
self.assertEqual(my_sendgrid.apikey, "THISISMYKEY")

def test_apikey_setter(self):
sg_apikey_setter = sendgrid.SendGridAPIClient(apikey="THISISMYKEY")
self.assertEqual(sg_apikey_setter.apikey, "THISISMYKEY")
# Use apikey setter to change api key
sg_apikey_setter.apikey = "THISISMYNEWAPIKEY"
self.assertEqual(sg_apikey_setter.apikey, "THISISMYNEWAPIKEY")

def test_api_key_setter(self):
sg_api_key_setter = sendgrid.SendGridAPIClient(apikey="THISISMYKEY")
self.assertEqual(sg_api_key_setter.apikey, "THISISMYKEY")
# Use api_key setter to change api key
sg_api_key_setter.api_key = "THISISMYNEWAPI_KEY"
self.assertEqual(sg_api_key_setter.apikey, "THISISMYNEWAPI_KEY")

def test_impersonate_subuser_init(self):
temp_subuser = '[email protected]'
sg_impersonate = sendgrid.SendGridAPIClient(
Expand Down