Debian Codegraph @

keystoneclient/tests/unit/v2_0/test_certificates.py

raw symbols SCIP
1 # Copyright 2014 IBM Corp.
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
14 import testresources
15
16 from keystoneclient.tests.unit import client_fixtures
17 from keystoneclient.tests.unit.v2_0 import utils
18
19
20 class CertificateTests(utils.ClientTestCase, testresources.ResourcedTestCase):
21
22 resources = [('examples', client_fixtures.EXAMPLES_RESOURCE)]
23
24 def test_get_ca_certificate(self):
25 self.stub_url('GET', ['certificates', 'ca'],
26 headers={'Content-Type': 'text/html; charset=UTF-8'},
27 text=self.examples.SIGNING_CA)
28 res = self.client.certificates.get_ca_certificate()
29 self.assertEqual(self.examples.SIGNING_CA, res)
30
31 def test_get_signing_certificate(self):
32 self.stub_url('GET', ['certificates', 'signing'],
33 headers={'Content-Type': 'text/html; charset=UTF-8'},
34 text=self.examples.SIGNING_CERT)
35 res = self.client.certificates.get_signing_certificate()
36 self.assertEqual(self.examples.SIGNING_CERT, res)
37
38
39 def load_tests(loader, tests, pattern):
40 return testresources.OptimisingTestSuite(tests)