def test_get_credentials(self): credentials = ub.Credentials(self.client_key, self.secret_key) client_credentials = credentials.get_credentials() client_key = client_credentials['client_key'] secret_key = client_credentials['secret_key'] self.assertEqual(self.client_key, client_key) self.assertEqual(self.secret_key, secret_key)
def test_empty_credentials_exception(self): with self.assertRaises(Exception): ub.Credentials() ub.Credentials('1') with self.assertRaises(ub.GeneralError): ub.Credentials(None, '1') ub.Credentials('', 2) ub.Credentials('', '') ub.Credentials(2, '')
def setUp(self): self.client_key = 'ACCESS-KEY' self.secret_key = 'SECRET-KEY' credentials = ub.Credentials(self.client_key, self.secret_key) self.client = ub.APIClient(ub.APIClient, credentials) self.assertIsInstance(self.client, ub.APIClient)
def test_credentials(self): credentials = ub.Credentials(self.client_key, self.secret_key) self.assertIsInstance(credentials, ub.Credentials)