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', {})
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)
def test_init_without_account_id(self): spotinst.ACCOUNT_ID = None base = spotinst.SpotinstBase('Unit Test Action', {}) self.assertEquals(base._client._client._tokens, {})
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')
def test_init_without_account_id(self): spotinst.ACCOUNT_ID = None with self.assertRaises(exceptions.InvalidCredentials): spotinst.SpotinstBase('Unit Test Action', {})
def test_init_missing_token(self): spotinst.TOKEN = None with self.assertRaises(exceptions.InvalidCredentials): spotinst.SpotinstBase('Unit Test Action', {})