Add `flavor` support for v2

This patch is targeting for the library layer, the cli support
will be tracked by another patch.

Change-Id: I284db15b66360f4bae317239a90743b4965bd016
This commit is contained in:
Fei Long Wang 2015-11-14 23:22:04 +13:00 committed by Victoria Martinez de la Cruz
parent 808ea8b71a
commit 1ef4a95ed6
5 changed files with 84 additions and 0 deletions

View File

@ -0,0 +1,26 @@
# Copyright (c) 2014 Red Hat, Inc.
#
# 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.
from zaqarclient.tests.queues import flavor
from zaqarclient.transport import http
class QueuesV2FlavorHttpFunctionalTest(flavor.QueuesV2FlavorFunctionalTest):
is_functional = True
transport_cls = http.HttpTransport
url = 'http://127.0.0.1:8888'
version = 2

View File

@ -0,0 +1,25 @@
# Copyright (c) 2014 Red Hat, Inc.
#
# 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.
from zaqarclient.tests.queues import flavor
from zaqarclient.transport import http
class QueuesV2FlavorHttpUnitTest(flavor.QueuesV2FlavorUnitTest):
transport_cls = http.HttpTransport
url = 'http://127.0.0.1:8888/v2'
version = 2

View File

@ -46,6 +46,11 @@ message_list = core.message_list
message_post = core.message_post
message_delete = core.message_delete
message_delete_many = core.message_delete_many
flavor_get = core.flavor_get
flavor_create = core.flavor_create
flavor_delete = core.flavor_delete
flavor_update = core.flavor_update
flavor_list = core.flavor_list
def signed_url_create(transport, request, queue_name, paths=None,

View File

@ -0,0 +1,20 @@
# Copyright (c) 2015 Catalyst IT Ltd.
#
# 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.
from zaqarclient.queues.v1 import flavor
class Flavor(flavor.Flavor):
pass

View File

@ -191,3 +191,11 @@ class QueuesV1_1FlavorFunctionalTest(base.QueuesTestBase):
flavor_data = {'pool': 'us'}
flavor = self.client.flavor('tasty', **flavor_data)
flavor.delete()
class QueuesV2FlavorUnitTest(QueuesV1_1FlavorUnitTest):
pass
class QueuesV2FlavorFunctionalTest(QueuesV1_1FlavorFunctionalTest):
pass