-
Notifications
You must be signed in to change notification settings - Fork 716
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for sendgrid.py apikey and api_key setters
- Loading branch information
Krista LaFentres
committed
Oct 23, 2017
1 parent
0884519
commit 2e85c52
Showing
1 changed file
with
14 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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( | ||
|