Merge "add get one deployable method and negative test"
This commit is contained in:
@@ -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 = {
|
||||
|
33
cyborg_tempest_plugin/tests/api/test_deployable_negative.py
Normal file
33
cyborg_tempest_plugin/tests/api/test_deployable_negative.py
Normal 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)
|
Reference in New Issue
Block a user