summaryrefslogtreecommitdiff
path: root/novaclient/tests/unit/v2/contrib/test_server_external_events.py
diff options
context:
space:
mode:
authorAndrey Kurilin <akurilin@mirantis.com>2015-02-03 02:32:58 +0200
committerAndrey Kurilin <akurilin@mirantis.com>2015-02-04 17:40:46 +0200
commit0a60aae852d2688861d0b4ba097a1a00529f0611 (patch)
treeb08ba9344b88e38767f54c5d5c7366c2ef306608 /novaclient/tests/unit/v2/contrib/test_server_external_events.py
parent4e76f9590b49c925703cbbf42d1e232725465eff (diff)
Rename v1_1 to v2
Module novaclient.v1_1 is used as implementation of V1.1, V2 and V3. Since future development(microversioning) will be done across V2, implementation should be done in appropriate module(to prevent misleading). Despite the fact that implementation for all versions are equal, discover method for contrib path worked only for v1.1. This patch fixes this bug and modifies shell tests to check all versions. Change-Id: Ib6798f4dfe177586302141f522dc593560ce6a5b
Notes
Notes (review): Verified+2: Jenkins Code-Review+2: Kevin L. Mitchell <kevin.mitchell@rackspace.com> Code-Review+2: Sean Dague <sean@dague.net> Workflow+1: Sean Dague <sean@dague.net> Submitted-by: Jenkins Submitted-at: Thu, 05 Feb 2015 00:17:20 +0000 Reviewed-on: https://review.openstack.org/149006 Project: openstack/python-novaclient Branch: refs/heads/master
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')