示例#1
0
 def test_init_missing_token(self):
     # Un-set the token and make sure the init fails
     spotinst.TOKEN = None
     with self.assertRaises(exceptions.InvalidCredentials):
         spotinst.SpotinstBase('Unit Test Action', {})
示例#2
0
 def test_init_with_debug_disabled(self):
     spotinst.DEBUG = False
     spotinst.SpotinstBase('Unit Test Action', {})
     self.assertEquals(
         20, logging.getLogger('tornado_rest_client.api').level)
示例#3
0
 def test_init_without_account_id(self):
     spotinst.ACCOUNT_ID = None
     base = spotinst.SpotinstBase('Unit Test Action', {})
     self.assertEquals(base._client._client._tokens, {})
示例#4
0
 def test_init_with_account_id(self):
     spotinst.ACCOUNT_ID = 'act-123456'
     base = spotinst.SpotinstBase('Unit Test Action', {})
     self.assertEquals(base._client._client._tokens['accountId'],
                       'act-123456')
示例#5
0
 def test_init_without_account_id(self):
     spotinst.ACCOUNT_ID = None
     with self.assertRaises(exceptions.InvalidCredentials):
         spotinst.SpotinstBase('Unit Test Action', {})
示例#6
0
 def test_init_missing_token(self):
     spotinst.TOKEN = None
     with self.assertRaises(exceptions.InvalidCredentials):
         spotinst.SpotinstBase('Unit Test Action', {})