| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 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) |