summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>2015-04-06 23:55:46 +0000
committerKen'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>2015-04-13 00:07:06 +0000
commit7e3ccd5341b165199bea14f65d2e758ee9bfc0eb (patch)
tree95c6ce514210bc8bd7195d3698597ecf4e3b386d
parent7c8fcc67343fc6e968213fddadb8e0e1ea58cbcb (diff)
downloadtempest-7e3ccd5341b165199bea14f65d2e758ee9bfc0eb.tar.gz
Apply a naming rule of GET to messaging client
[GET /resources] methods should be "list_<resource name>s" or "show_<resource name>", so this patch applies the rule to messaging client. Partially implements blueprint consistent-service-method-names Change-Id: Ibae5f78b3dee12dbab5095872b8d868fbfec7f5d
-rw-r--r--tempest/api/messaging/base.py10
-rw-r--r--tempest/api/messaging/test_messages.py10
-rw-r--r--tempest/api/messaging/test_queues.py2
-rw-r--r--tempest/services/messaging/json/messaging_client.py10
4 files changed, 16 insertions, 16 deletions
diff --git a/tempest/api/messaging/base.py b/tempest/api/messaging/base.py
index b3ed94182..c4214f27c 100644
--- a/tempest/api/messaging/base.py
+++ b/tempest/api/messaging/base.py
@@ -71,7 +71,7 @@ class BaseMessagingTest(test.BaseTestCase):
@classmethod
def check_queue_exists(cls, queue_name):
"""Wrapper utility that checks the existence of a test queue."""
- resp, body = cls.client.get_queue(queue_name)
+ resp, body = cls.client.show_queue(queue_name)
return resp, body
@classmethod
@@ -89,13 +89,13 @@ class BaseMessagingTest(test.BaseTestCase):
@classmethod
def get_queue_stats(cls, queue_name):
"""Wrapper utility that returns the queue stats."""
- resp, body = cls.client.get_queue_stats(queue_name)
+ resp, body = cls.client.show_queue_stats(queue_name)
return resp, body
@classmethod
def get_queue_metadata(cls, queue_name):
"""Wrapper utility that gets a queue metadata."""
- resp, body = cls.client.get_queue_metadata(queue_name)
+ resp, body = cls.client.show_queue_metadata(queue_name)
return resp, body
@classmethod
@@ -121,14 +121,14 @@ class BaseMessagingTest(test.BaseTestCase):
@classmethod
def get_single_message(cls, message_uri):
"""Wrapper utility that gets a single message."""
- resp, body = cls.client.get_single_message(message_uri)
+ resp, body = cls.client.show_single_message(message_uri)
return resp, body
@classmethod
def get_multiple_messages(cls, message_uri):
"""Wrapper utility that gets multiple messages."""
- resp, body = cls.client.get_multiple_messages(message_uri)
+ resp, body = cls.client.show_multiple_messages(message_uri)
return resp, body
diff --git a/tempest/api/messaging/test_messages.py b/tempest/api/messaging/test_messages.py
index f982f597a..c8640b3f1 100644
--- a/tempest/api/messaging/test_messages.py
+++ b/tempest/api/messaging/test_messages.py
@@ -49,7 +49,7 @@ class TestMessages(base.BaseMessagingTest):
# Get on the posted messages
message_uri = resp['location']
- resp, _ = self.client.get_multiple_messages(message_uri)
+ resp, _ = self.client.show_multiple_messages(message_uri)
# The test has an assertion here, because the response cannot be 204
# in this case (the client allows 200 or 204 for this API call).
self.assertEqual('200', resp['status'])
@@ -74,7 +74,7 @@ class TestMessages(base.BaseMessagingTest):
message_uri = body['resources'][0]
# Get posted message
- resp, _ = self.client.get_single_message(message_uri)
+ resp, _ = self.client.show_single_message(message_uri)
# The test has an assertion here, because the response cannot be 204
# in this case (the client allows 200 or 204 for this API call).
self.assertEqual('200', resp['status'])
@@ -87,7 +87,7 @@ class TestMessages(base.BaseMessagingTest):
message_uri = resp['location']
# Get posted messages
- resp, _ = self.client.get_multiple_messages(message_uri)
+ resp, _ = self.client.show_multiple_messages(message_uri)
# The test has an assertion here, because the response cannot be 204
# in this case (the client allows 200 or 204 for this API call).
self.assertEqual('200', resp['status'])
@@ -103,7 +103,7 @@ class TestMessages(base.BaseMessagingTest):
self.client.delete_messages(message_uri)
message_uri = message_uri.replace('/messages/', '/messages?ids=')
- resp, _ = self.client.get_multiple_messages(message_uri)
+ resp, _ = self.client.show_multiple_messages(message_uri)
# The test has an assertion here, because the response has to be 204
# in this case (the client allows 200 or 204 for this API call).
self.assertEqual('204', resp['status'])
@@ -117,7 +117,7 @@ class TestMessages(base.BaseMessagingTest):
# Delete multiple messages
self.client.delete_messages(message_uri)
- resp, _ = self.client.get_multiple_messages(message_uri)
+ resp, _ = self.client.show_multiple_messages(message_uri)
# The test has an assertion here, because the response has to be 204
# in this case (the client allows 200 or 204 for this API call).
self.assertEqual('204', resp['status'])
diff --git a/tempest/api/messaging/test_queues.py b/tempest/api/messaging/test_queues.py
index c444e0b67..2dac346e0 100644
--- a/tempest/api/messaging/test_queues.py
+++ b/tempest/api/messaging/test_queues.py
@@ -44,7 +44,7 @@ class TestQueues(base.BaseMessagingTest):
self.delete_queue(queue_name)
self.assertRaises(lib_exc.NotFound,
- self.client.get_queue,
+ self.client.show_queue,
queue_name)
diff --git a/tempest/services/messaging/json/messaging_client.py b/tempest/services/messaging/json/messaging_client.py
index 36444a97d..483ba93e7 100644
--- a/tempest/services/messaging/json/messaging_client.py
+++ b/tempest/services/messaging/json/messaging_client.py
@@ -58,7 +58,7 @@ class MessagingClientJSON(service_client.ServiceClient):
self.expected_success(201, resp.status)
return resp, body
- def get_queue(self, queue_name):
+ def show_queue(self, queue_name):
uri = '{0}/queues/{1}'.format(self.uri_prefix, queue_name)
resp, body = self.get(uri)
self.expected_success(204, resp.status)
@@ -76,14 +76,14 @@ class MessagingClientJSON(service_client.ServiceClient):
self.expected_success(204, resp.status)
return resp, body
- def get_queue_stats(self, queue_name):
+ def show_queue_stats(self, queue_name):
uri = '{0}/queues/{1}/stats'.format(self.uri_prefix, queue_name)
resp, body = self.get(uri)
body = json.loads(body)
self.validate_response(queues_schema.queue_stats, resp, body)
return resp, body
- def get_queue_metadata(self, queue_name):
+ def show_queue_metadata(self, queue_name):
uri = '{0}/queues/{1}/metadata'.format(self.uri_prefix, queue_name)
resp, body = self.get(uri)
self.expected_success(200, resp.status)
@@ -117,7 +117,7 @@ class MessagingClientJSON(service_client.ServiceClient):
return resp, body
- def get_single_message(self, message_uri):
+ def show_single_message(self, message_uri):
resp, body = self.get(message_uri, extra_headers=True,
headers=self.headers)
if resp['status'] != '204':
@@ -126,7 +126,7 @@ class MessagingClientJSON(service_client.ServiceClient):
body)
return resp, body
- def get_multiple_messages(self, message_uri):
+ def show_multiple_messages(self, message_uri):
resp, body = self.get(message_uri, extra_headers=True,
headers=self.headers)