예제 #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', {})