'Test ec2 credential deletion.'

def test_ec2_delete_credential(self):

    ec2_cred = self._get_ec2_cred()
    uri = '/'.join([self._get_ec2_cred_uri(), ec2_cred['access']])
    cred_from_credential_api = self.credential_api.list_credentials_for_user(self.user_id, type=CRED_TYPE_EC2)
    self.assertEqual(1, len(cred_from_credential_api))
    self.delete(uri)
    self.assertRaises(exception.CredentialNotFound, self.credential_api.get_credential, cred_from_credential_api[0]['id'])
