summaryrefslogtreecommitdiff
path: root/novaclient/tests/unit/v2/contrib/test_instance_actions.py
diff options
context:
space:
mode:
Diffstat (limited to 'novaclient/tests/unit/v2/contrib/test_instance_actions.py')
-rw-r--r--novaclient/tests/unit/v2/contrib/test_instance_actions.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/novaclient/tests/unit/v2/contrib/test_instance_actions.py b/novaclient/tests/unit/v2/contrib/test_instance_actions.py
new file mode 100644
index 0000000..0b0400a
--- /dev/null
+++ b/novaclient/tests/unit/v2/contrib/test_instance_actions.py
@@ -0,0 +1,43 @@
1# Copyright 2013 Rackspace Hosting
2# All Rights Reserved.
3#
4# Licensed under the Apache License, Version 2.0 (the "License"); you may
5# not use this file except in compliance with the License. You may obtain
6# a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13# License for the specific language governing permissions and limitations
14# under the License.
15
16from novaclient import extension
17from novaclient.tests.unit import utils
18from novaclient.tests.unit.v2.contrib import fakes
19from novaclient.v2.contrib import instance_action
20
21
22extensions = [
23 extension.Extension(instance_action.__name__.split(".")[-1],
24 instance_action),
25]
26cs = fakes.FakeClient(extensions=extensions)
27
28
29class InstanceActionExtensionTests(utils.TestCase):
30 def test_list_instance_actions(self):
31 server_uuid = '1234'
32 cs.instance_action.list(server_uuid)
33 cs.assert_called(
34 'GET', '/servers/%s/os-instance-actions' %
35 server_uuid)
36
37 def test_get_instance_action(self):
38 server_uuid = '1234'
39 request_id = 'req-abcde12345'
40 cs.instance_action.get(server_uuid, request_id)
41 cs.assert_called(
42 'GET', '/servers/%s/os-instance-actions/%s'
43 % (server_uuid, request_id))