File tree Expand file tree Collapse file tree 4 files changed +12
-2
lines changed Expand file tree Collapse file tree 4 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 11# Change Log
22All notable changes to this project will be documented in this file.
33
4+ ## [ 3.1.9] - 2016-07-26 ##
5+ ### Fixed
6+ - [ Issue #197 ] ( https://github.com/sendgrid/sendgrid-python/issues/197 ) : api_key / apikey attribute logic incorrect
7+ - Thanks to [ johguse] ( https://github.com/johguse ) for reporting the bug
8+
49## [ 3.1.8] - 2016-07-25 ##
510### Added
611- [ Troubleshooting] ( https://github.com/sendgrid/sendgrid-python/blob/master/TROUBLESHOOTING.md ) section
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ def __init__(self, **opts):
1515 self .path = opts .get ('path' , os .path .abspath (os .path .dirname (__file__ )))
1616 self ._apikey = opts .get ('apikey' , os .environ .get ('SENDGRID_API_KEY' ))
1717 # Support v2 api_key naming
18- self ._apikey = opts .get ('api_key' , os . environ . get ( 'SENDGRID_API_KEY' ) )
18+ self ._apikey = opts .get ('api_key' , self . _apikey )
1919 self ._api_key = self ._apikey
2020 self .useragent = 'sendgrid/{0};python' .format (__version__ )
2121 self .host = opts .get ('host' , 'https://api.sendgrid.com' )
Original file line number Diff line number Diff line change 1- version_info = (3 , 1 , 8 )
1+ version_info = (3 , 1 , 9 )
22__version__ = '.' .join (str (v ) for v in version_info )
Original file line number Diff line number Diff line change @@ -40,6 +40,11 @@ def test_apikey_init(self):
4040 self .assertEqual (self .sg .apikey , os .environ .get ('SENDGRID_API_KEY' ))
4141 # Support the previous naming convention for API keys
4242 self .assertEqual (self .sg .api_key , self .sg .apikey )
43+ my_sendgrid = sendgrid .SendGridAPIClient (apikey = "THISISMYKEY" )
44+ tmp = os .environ .get ('SENDGRID_API_KEY' )
45+ os .environ ['SENDGRID_API_KEY' ] = ""
46+ self .assertEqual (my_sendgrid .apikey , "THISISMYKEY" )
47+ os .environ ['SENDGRID_API_KEY' ] = tmp
4348
4449 def test_useragent (self ):
4550 useragent = '{0}{1}{2}' .format ('sendgrid/' , __version__ , ';python' )
You can’t perform that action at this time.
0 commit comments