summaryrefslogtreecommitdiff
path: root/novaclient/tests/unit/v2/contrib/test_server_external_events.py
diff options
context:
space:
mode:
Diffstat (limited to 'novaclient/tests/unit/v2/contrib/test_server_external_events.py')
-rw-r--r--novaclient/tests/unit/v2/contrib/test_server_external_events.py44
1 files changed, 44 insertions, 0 deletions
diff --git a/novaclient/tests/unit/v2/contrib/test_server_external_events.py b/novaclient/tests/unit/v2/contrib/test_server_external_events.py
new file mode 100644
index 0000000..1b941c9
--- /dev/null
+++ b/novaclient/tests/unit/v2/contrib/test_server_external_events.py
@@ -0,0 +1,44 @@
1# Copyright (C) 2014, Red Hat, Inc.
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may
4# not use this file except in compliance with the License. You may obtain
5# a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations
13# under the License.
14
15"""
16External event triggering for servers, not to be used by users.
17"""
18
19from novaclient import extension
20from novaclient.tests.unit import utils
21from novaclient.tests.unit.v2.contrib import fakes
22from novaclient.v2.contrib import server_external_events as ext_events
23
24
25extensions = [
26 extension.Extension(ext_events.__name__.split(".")[-1],
27 ext_events),
28]
29cs = fakes.FakeClient(extensions=extensions)
30
31
32class ServerExternalEventsTestCase(utils.TestCase):
33 def test_external_event(self):
34 events = [{'server_uuid': 'fake-uuid1',
35 'name': 'test-event',
36 'status': 'completed',
37 'tag': 'tag'},
38 {'server_uuid': 'fake-uuid2',
39 'name': 'test-event',
40 'status': 'completed',
41 'tag': 'tag'}]
42 result = cs.server_external_events.create(events)
43 self.assertEqual(events, result)
44 cs.assert_called('POST', '/os-server-external-events')