Ejemplo n.º 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', {})
Ejemplo n.º 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)
Ejemplo n.º 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, {})
Ejemplo n.º 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')
Ejemplo n.º 5
0
 def test_init_without_account_id(self):
     spotinst.ACCOUNT_ID = None
     with self.assertRaises(exceptions.InvalidCredentials):
         spotinst.SpotinstBase('Unit Test Action', {})
Ejemplo n.º 6
0
 def test_init_missing_token(self):
     spotinst.TOKEN = None
     with self.assertRaises(exceptions.InvalidCredentials):
         spotinst.SpotinstBase('Unit Test Action', {})