Merge "add get one deployable method and negative test"

This commit is contained in:
Zuul
2021-01-05 12:38:55 +00:00
committed by Gerrit Code Review
2 changed files with 37 additions and 0 deletions

View File

@@ -102,6 +102,10 @@ class CyborgRestClient(rest_client.RestClient):
resp, body = self.delete(url)
return self._response_helper(resp, body)
def get_deployable(self, deployable_uuid):
resp, body = self.get("/deployables/%s" % deployable_uuid)
return self._response_helper(resp, body)
def get_auth_provider(credentials, scope='project'):
default_params = {

View File

@@ -0,0 +1,33 @@
# Copyright 2020 Inspur
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import uuid
from cyborg_tempest_plugin.tests.api import base
from tempest.lib import exceptions as lib_exc
from tempest import test
class DeployableNegativeTest(base.BaseAPITest):
credentials = ['admin']
@test.attr(type=['negative', 'gate'])
def test_get_non_existent_deployable(self):
# get the non-existent deployable
non_existent_id = str(uuid.uuid4())
self.assertRaises(lib_exc.NotFound,
self.os_admin.cyborg_client.get_deployable,
non_existent_id)