Merge "Start adding support for v1.1"

This commit is contained in:
Jenkins 2014-09-16 15:44:50 +00:00 committed by Gerrit Code Review
commit 823ffe0530
8 changed files with 43 additions and 6 deletions

View File

@ -37,8 +37,12 @@ zaqarclient.transport =
http.v1 = zaqarclient.transport.http:HttpTransport
https.v1 = zaqarclient.transport.http:HttpTransport
http.v1.1 = zaqarclient.transport.http:HttpTransport
https.v1.1 = zaqarclient.transport.http:HttpTransport
zaqarclient.api =
queues.v1 = zaqarclient.queues.v1.api:V1
queues.v1.1 = zaqarclient.queues.v1.api:V1_1
openstack.queuing.v1 =
queue_list = zaqarclient.queues.v1.cli:ListQueues

View File

@ -16,3 +16,5 @@ nose-exclude
openstack.nose_plugin>=0.7
# Metrics and style
coverage>=3.6
ddt>=0.4.0

View File

@ -23,3 +23,10 @@ class QueuesV1ClaimsHttpUnitTest(claims.QueueV1ClaimUnitTest):
transport_cls = http.HttpTransport
url = 'http://127.0.0.1:8888/v1'
version = 1
class QueuesV1_1ClaimsHttpUnitTest(claims.QueueV1ClaimUnitTest):
transport_cls = http.HttpTransport
url = 'http://127.0.0.1:8888/v1.1'
version = 1.1

View File

@ -15,24 +15,29 @@
import mock
import ddt
from zaqarclient.queues import client
from zaqarclient.queues.v1 import core
from zaqarclient.tests import base
from zaqarclient.transport import response
VERSION = 1
VERSIONS = [1, 1.1]
@ddt.ddt
class TestClient(base.TestBase):
def test_transport(self):
@ddt.data(*VERSIONS)
def test_transport(self, version):
cli = client.Client('http://example.com',
VERSION, {})
version, {})
self.assertIsNotNone(cli.transport())
def test_health(self):
@ddt.data(*VERSIONS)
def test_health(self, version):
cli = client.Client('http://example.com',
VERSION, {})
version, {})
with mock.patch.object(core, 'health', autospec=True) as core_health:
resp = response.Response(None, None)
core_health.return_value = resp

View File

@ -109,3 +109,10 @@ class QueuesV1MessageHttpUnitTest(test_message.QueuesV1MessageUnitTest):
transport_cls = http.HttpTransport
url = 'http://127.0.0.1:8888/v1'
version = 1
class QueuesV1_1MessageHttpUnitTest(test_message.QueuesV1MessageUnitTest):
transport_cls = http.HttpTransport
url = 'http://127.0.0.1:8888/v1.1'
version = 1.1

View File

@ -23,3 +23,10 @@ class QueuesV1QueueHttpUnitTest(queues.QueuesV1QueueUnitTest):
transport_cls = http.HttpTransport
url = 'http://127.0.0.1:8888/v1'
version = 1
class QueuesV1_1QueueHttpUnitTest(queues.QueuesV1QueueUnitTest):
transport_cls = http.HttpTransport
url = 'http://127.0.0.1:8888/v1.1'
version = 1.1

View File

@ -16,7 +16,8 @@
from zaqarclient import errors
from zaqarclient.queues.v1 import client as cv1
_CLIENTS = {1: cv1.Client}
_CLIENTS = {1: cv1.Client,
1.1: cv1.Client}
def Client(url=None, version=None, conf=None):

View File

@ -210,3 +210,7 @@ class V1(api.Api):
'method': 'GET',
},
}
class V1_1(V1):
label = 'v1.1'