Skip to content

Commit

Permalink
Add tests for sendgrid.py apikey and api_key setters
Browse files Browse the repository at this point in the history
  • Loading branch information
Krista LaFentres committed Oct 23, 2017
1 parent 0884519 commit 2e85c52
Showing 1 changed file with 14 additions and 0 deletions.
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

0 comments on commit 2e85c52

Please sign in to comment.