Esempio n. 1
0
    def test_cred_get(self):
        cred = db_api.cred_get(self.ctx, USER_ID, PROJECT_ID)
        self.assertIsNone(cred)

        db_api.cred_create(self.ctx, values)

        cred = db_api.cred_get(self.ctx, USER_ID, PROJECT_ID)
        self.assertIsNotNone(cred)
        self.assertEqual(USER_ID, cred.user)
        self.assertEqual(PROJECT_ID, cred.project)
        self.assertEqual(
            {'openstack': {'trust': '01234567890123456789012345678901'}},
            cred.cred)
        self.assertEqual({}, cred.data)
Esempio n. 2
0
    def test_cred_get(self):
        cred = db_api.cred_get(self.ctx, USER_ID, PROJECT_ID)
        self.assertIsNone(cred)

        db_api.cred_create(self.ctx, values)

        cred = db_api.cred_get(self.ctx, USER_ID, PROJECT_ID)
        self.assertIsNotNone(cred)
        self.assertEqual(USER_ID, cred.user)
        self.assertEqual(PROJECT_ID, cred.project)
        self.assertEqual(
            {'openstack': {
                'trust': '01234567890123456789012345678901'
            }}, cred.cred)
        self.assertEqual({}, cred.data)
Esempio n. 3
0
 def test_cred_update(self):
     db_api.cred_create(self.ctx, values)
     new_values = {'cred': {'openstack': {'trust': 'newtrust'}}}
     db_api.cred_update(self.ctx, USER_ID, PROJECT_ID, new_values)
     cred = db_api.cred_get(self.ctx, USER_ID, PROJECT_ID)
     self.assertIsNotNone(cred)
     self.assertEqual({'openstack': {'trust': 'newtrust'}}, cred.cred)
Esempio n. 4
0
 def test_cred_update(self):
     db_api.cred_create(self.ctx, values)
     new_values = {
         'cred': {
             'openstack': {
                 'trust': 'newtrust'
             }
         }
     }
     db_api.cred_update(self.ctx, USER_ID, PROJECT_ID, new_values)
     cred = db_api.cred_get(self.ctx, USER_ID, PROJECT_ID)
     self.assertIsNotNone(cred)
     self.assertEqual({'openstack': {'trust': 'newtrust'}},
                      cred.cred)