summaryrefslogtreecommitdiff
path: root/novaclient/tests/unit/v2/test_certs.py
diff options
context:
space:
mode:
Diffstat (limited to 'novaclient/tests/unit/v2/test_certs.py')
-rw-r--r--novaclient/tests/unit/v2/test_certs.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/novaclient/tests/unit/v2/test_certs.py b/novaclient/tests/unit/v2/test_certs.py
new file mode 100644
index 0000000..6ec2258
--- /dev/null
+++ b/novaclient/tests/unit/v2/test_certs.py
@@ -0,0 +1,36 @@
1#
2# Licensed under the Apache License, Version 2.0 (the "License"); you may
3# not use this file except in compliance with the License. You may obtain
4# a copy of the License at
5#
6# http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11# License for the specific language governing permissions and limitations
12# under the License.
13
14from novaclient.tests.unit.fixture_data import certs as data
15from novaclient.tests.unit.fixture_data import client
16from novaclient.tests.unit import utils
17from novaclient.v2 import certs
18
19
20class CertsTest(utils.FixturedTestCase):
21
22 data_fixture_class = data.Fixture
23 cert_type = certs.Certificate
24
25 scenarios = [('original', {'client_fixture_class': client.V1}),
26 ('session', {'client_fixture_class': client.SessionV1})]
27
28 def test_create_cert(self):
29 cert = self.cs.certs.create()
30 self.assert_called('POST', '/os-certificates')
31 self.assertIsInstance(cert, self.cert_type)
32
33 def test_get_root_cert(self):
34 cert = self.cs.certs.get()
35 self.assert_called('GET', '/os-certificates/root')
36 self.assertIsInstance(cert, self.cert_type)