summaryrefslogtreecommitdiff
path: root/heatclient/tests
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-06-05 05:34:39 +0000
committerGerrit Code Review <review@openstack.org>2017-06-05 05:34:39 +0000
commit847f9023377b93fc0636309d44ff636fb111d66c (patch)
treea4f63af0f9ca4c0eaaf137bfc4d63afe90473ec0 /heatclient/tests
parentee6ebb5d116c9373c238c3438cc5c08b59136264 (diff)
parenta625d3bb93a18193058a09cb7887e9cfa4ea9df0 (diff)
downloadpython-heatclient-847f9023377b93fc0636309d44ff636fb111d66c.tar.gz
Merge "Don't encode path separators"1.10.0
Diffstat (limited to 'heatclient/tests')
-rw-r--r--heatclient/tests/unit/test_events.py10
-rw-r--r--heatclient/tests/unit/test_resources.py12
-rw-r--r--heatclient/tests/unit/test_shell.py40
3 files changed, 31 insertions, 31 deletions
diff --git a/heatclient/tests/unit/test_events.py b/heatclient/tests/unit/test_events.py
index 1d4d84d..b63aebe 100644
--- a/heatclient/tests/unit/test_events.py
+++ b/heatclient/tests/unit/test_events.py
@@ -33,7 +33,7 @@ class EventManagerTest(testtools.TestCase):
manager.list(stack_id, resource_name)
# Make sure url is correct.
manager._list.assert_called_once_with(
- '/stacks/teststack%2Fabcd1234/'
+ '/stacks/teststack/abcd1234/'
'resources/testresource/events',
"events")
mock_re.assert_called_once_with(stack_id)
@@ -50,7 +50,7 @@ class EventManagerTest(testtools.TestCase):
manager.list(stack_id, resource_name)
# Make sure url is correct.
manager._list.assert_called_once_with(
- '/stacks/teststack%2Fabcd1234/'
+ '/stacks/teststack/abcd1234/'
'resources/%E5%B7%A5%E4%BD%9C/'
'events', "events")
mock_re.assert_called_once_with(stack_id)
@@ -88,7 +88,7 @@ class EventManagerTest(testtools.TestCase):
url, param = args[0]
self.assertEqual("events", param)
base_url, query_params = utils.parse_query_url(url)
- expected_base_url = ('/stacks/teststack%2Fabcd1234/'
+ expected_base_url = ('/stacks/teststack/abcd1234/'
'resources/testresource/events')
self.assertEqual(expected_base_url, base_url)
expected_query_dict = {'marker': ['6d6935f4-0ae5'],
@@ -110,7 +110,7 @@ class EventManagerTest(testtools.TestCase):
def json_request(self, *args, **kwargs):
expect = ('GET',
- '/stacks/teststack%2Fabcd1234/resources'
+ '/stacks/teststack/abcd1234/resources'
'/testresource/events/1')
assert args == expect
return {}, {'event': []}
@@ -137,7 +137,7 @@ class EventManagerTest(testtools.TestCase):
def json_request(self, *args, **kwargs):
expect = ('GET',
- '/stacks/teststack%2Fabcd1234/resources'
+ '/stacks/teststack/abcd1234/resources'
'/%E5%B7%A5%E4%BD%9C/events/1')
assert args == expect
return {}, {'event': []}
diff --git a/heatclient/tests/unit/test_resources.py b/heatclient/tests/unit/test_resources.py
index b3c5c30..96e8203 100644
--- a/heatclient/tests/unit/test_resources.py
+++ b/heatclient/tests/unit/test_resources.py
@@ -73,7 +73,7 @@ class ResourceManagerTest(testtools.TestCase):
fields = {'stack_id': 'teststack',
'resource_name': 'testresource'}
expect = ('GET',
- '/stacks/teststack%2Fabcd1234/resources'
+ '/stacks/teststack/abcd1234/resources'
'/testresource')
key = 'resource'
@@ -86,7 +86,7 @@ class ResourceManagerTest(testtools.TestCase):
'resource_name': 'testresource',
'with_attr': ['attr_a', 'attr_b']}
expect = ('GET',
- '/stacks/teststack%2Fabcd1234/resources'
+ '/stacks/teststack/abcd1234/resources'
'/testresource?with_attr=attr_a&with_attr=attr_b')
key = 'resource'
@@ -98,7 +98,7 @@ class ResourceManagerTest(testtools.TestCase):
fields = {'stack_id': 'teststack',
'resource_name': u'\u5de5\u4f5c'}
expect = ('GET',
- '/stacks/teststack%2Fabcd1234/resources'
+ '/stacks/teststack/abcd1234/resources'
'/%E5%B7%A5%E4%BD%9C')
key = 'resource'
@@ -154,7 +154,7 @@ class ResourceManagerTest(testtools.TestCase):
fields = {'stack_id': 'teststack',
'resource_name': 'testresource'}
expect = ('GET',
- '/stacks/teststack%2Fabcd1234/resources'
+ '/stacks/teststack/abcd1234/resources'
'/testresource/metadata')
key = 'metadata'
@@ -192,7 +192,7 @@ class ResourceManagerTest(testtools.TestCase):
'resource_name': 'testresource',
'data': 'Some content'}
expect = ('POST',
- '/stacks/teststack%2Fabcd1234/resources'
+ '/stacks/teststack/abcd1234/resources'
'/testresource/signal')
key = 'signal'
@@ -206,7 +206,7 @@ class ResourceManagerTest(testtools.TestCase):
'mark_unhealthy': 'True',
'resource_status_reason': 'Anything'}
expect = ('PATCH',
- '/stacks/teststack%2Fabcd1234/resources'
+ '/stacks/teststack/abcd1234/resources'
'/testresource')
key = 'mark_unhealthy'
diff --git a/heatclient/tests/unit/test_shell.py b/heatclient/tests/unit/test_shell.py
index abb5845..cdf6a74 100644
--- a/heatclient/tests/unit/test_shell.py
+++ b/heatclient/tests/unit/test_shell.py
@@ -563,7 +563,7 @@ class ShellTestNoMox(TestCase):
rsrc_eventid2=eventid2
)
- self.requests.get('http://heat.example.com/stacks/myStack%2F60f83b5e/'
+ self.requests.get('http://heat.example.com/stacks/myStack/60f83b5e/'
'resources/myDeployment/events',
headers={'Content-Type': 'application/json'},
json=resp_dict)
@@ -2622,9 +2622,9 @@ class ShellTestEvents(ShellBase):
resource_name = 'testresource/1'
self.mock_request_get(
'/stacks/%s/resources/%s/events?sort_dir=asc' % (
- parse.quote(stack_id, ''),
+ parse.quote(stack_id),
parse.quote(encodeutils.safe_encode(
- resource_name), '')),
+ resource_name))),
resp_dict)
self.m.ReplayAll()
@@ -2698,10 +2698,10 @@ class ShellTestEvents(ShellBase):
self.mock_request_get(
'/stacks/%s/resources/%s/events/%s' %
(
- parse.quote(stack_id, ''),
+ parse.quote(stack_id),
parse.quote(encodeutils.safe_encode(
- resource_name), ''),
- parse.quote(self.event_id_one, '')
+ resource_name)),
+ parse.quote(self.event_id_one)
),
resp_dict)
@@ -3281,9 +3281,9 @@ class ShellTestResources(ShellBase):
self.mock_request_get(
'/stacks/%s/resources/%s?with_attr=attr_a&with_attr=attr_b' %
(
- parse.quote(stack_id, ''),
+ parse.quote(stack_id),
parse.quote(encodeutils.safe_encode(
- resource_name), '')
+ resource_name))
), resp_dict)
self.m.ReplayAll()
@@ -3323,9 +3323,9 @@ class ShellTestResources(ShellBase):
self.mock_request_post(
'/stacks/%s/resources/%s/signal' %
(
- parse.quote(stack_id, ''),
+ parse.quote(stack_id),
parse.quote(encodeutils.safe_encode(
- resource_name), '')
+ resource_name))
),
'',
data={'message': 'Content'}
@@ -3345,9 +3345,9 @@ class ShellTestResources(ShellBase):
self.mock_request_post(
'/stacks/%s/resources/%s/signal' %
(
- parse.quote(stack_id, ''),
+ parse.quote(stack_id),
parse.quote(encodeutils.safe_encode(
- resource_name), '')
+ resource_name))
),
'',
data=None
@@ -3405,9 +3405,9 @@ class ShellTestResources(ShellBase):
self.mock_request_post(
'/stacks/%s/resources/%s/signal' %
(
- parse.quote(stack_id, ''),
+ parse.quote(stack_id),
parse.quote(encodeutils.safe_encode(
- resource_name), '')
+ resource_name))
),
'',
data={'message': 'Content'}
@@ -3430,9 +3430,9 @@ class ShellTestResources(ShellBase):
self.mock_request_patch(
'/stacks/%s/resources/%s' %
(
- parse.quote(stack_id, ''),
+ parse.quote(stack_id),
parse.quote(encodeutils.safe_encode(
- resource_name), '')
+ resource_name))
),
'',
req_headers=False,
@@ -3453,9 +3453,9 @@ class ShellTestResources(ShellBase):
self.mock_request_patch(
'/stacks/%s/resources/%s' %
(
- parse.quote(stack_id, ''),
+ parse.quote(stack_id),
parse.quote(encodeutils.safe_encode(
- resource_name), '')
+ resource_name))
),
'',
req_headers=False,
@@ -3476,9 +3476,9 @@ class ShellTestResources(ShellBase):
self.mock_request_patch(
'/stacks/%s/resources/%s' %
(
- parse.quote(stack_id, ''),
+ parse.quote(stack_id),
parse.quote(encodeutils.safe_encode(
- resource_name), '')
+ resource_name))
),
'',
req_headers=False,