Fixes wrong variable invoking during get transport

Now the method of transport() of queues/v1/client.py is invoking
wrong variable name. This patch fixes it and add an unit test.

NOTE: More unit test cases for v1/client.py will be added in a
separate patch.

Change-Id: I75a2498002bb2b9b7475bef0af5eebc8d82d662d
Closes-Bug: #1266467
This commit is contained in:
Fei Long Wang
2014-01-07 13:54:33 +08:00
parent ee52825498
commit 4724016a95
2 changed files with 28 additions and 1 deletions

View File

@@ -75,7 +75,7 @@ class Client(object):
def transport(self):
"""Gets a transport based the api url and version."""
return transport.get_transport_for(self.url,
return transport.get_transport_for(self.api_url,
self.api_version)
def queue(self, ref, **kwargs):

View File

@@ -0,0 +1,27 @@
# Copyright 2014 IBM Corp.
#
# 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 marconiclient.queues import client
from marconiclient.tests import base
VERSION = 1
class TestClient(base.TestBase):
def test_transport(self):
cli = client.Client('http://example.com',
VERSION, {})
self.assertIsNotNone(cli.transport())