Added support to claims

Zaqarclient v2 currently has missing features such as 'claims',
'flavors', and 'pools' that are needed in order to start implementing
a subscription management. I added support to claims as a priorital
step.

Co-Authored-By: MD NADEEM<md.nadeem@nectechnologies.in>
Change-Id: Id16e2f6a390e8387cce4545b9a03181ba03da3ce
This commit is contained in:
dynarro 2015-12-10 16:17:27 +05:30 committed by Fei Long Wang
parent 2d51367764
commit 947ac048a9
6 changed files with 93 additions and 0 deletions

View File

@ -24,3 +24,11 @@ class QueuesV1ClaimHttpFunctionalTest(claims.QueuesV1ClaimFunctionalTest):
transport_cls = http.HttpTransport
url = 'http://127.0.0.1:8888'
version = 1
class QueuesV1_1ClaimHttpFunctionalTest(claims.QueuesV1_1ClaimFunctionalTest):
is_functional = True
transport_cls = http.HttpTransport
url = 'http://127.0.0.1:8888'
version = 1.1

View File

@ -0,0 +1,25 @@
# Copyright (c) 2014 Rackspace Hosting.
#
# 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 claims
from zaqarclient.transport import http
class QueuesV2ClaimHttpFunctionalTest(claims.QueuesV2ClaimFunctionalTest):
is_functional = True
transport_cls = http.HttpTransport
url = 'http://127.0.0.1:8888'
version = 2

View File

@ -0,0 +1,24 @@
# Copyright (c) Rackspace Hosting.
#
# 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 claims
from zaqarclient.transport import http
class QueuesV2ClaimsHttpUnitTest(claims.QueueV2ClaimUnitTest):
transport_cls = http.HttpTransport
url = 'http://127.0.0.1:8888/v2'
version = 2

View File

@ -0,0 +1,20 @@
# Copyright (c) 2014 Rackspace, 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.queues.v1 import claim
class Claim(claim.Claim):
pass

View File

@ -56,6 +56,10 @@ flavor_create = core.flavor_create
flavor_delete = core.flavor_delete
flavor_update = core.flavor_update
flavor_list = core.flavor_list
claim_create = core.claim_create
claim_get = core.claim_get
claim_update = core.claim_update
claim_delete = core.claim_delete
def signed_url_create(transport, request, queue_name, paths=None,

View File

@ -181,3 +181,15 @@ class QueueV1_1ClaimUnitTest(QueueV1ClaimUnitTest):
num_tested += 1
self.assertEqual(result[num]['href'], msg.href)
self.assertEqual(len(result), num_tested)
class QueuesV1_1ClaimFunctionalTest(QueuesV1ClaimFunctionalTest):
pass
class QueueV2ClaimUnitTest(QueueV1_1ClaimUnitTest):
pass
class QueuesV2ClaimFunctionalTest(QueuesV1_1ClaimFunctionalTest):
pass