Browse Source

Add project_id field to ssl_cert GET response

Change-Id: I48d60678c20f15351fbcc0f951e47af75a92a4f6
tags/1.0.10
Isaac Mungai 3 years ago
parent
commit
ac9c1b99ea
3 changed files with 5 additions and 1 deletions
  1. +2
    -1
      poppy/transport/pecan/models/response/ssl_certificate.py
  2. +1
    -0
      tests/api/ssl_certificate/test_create_ssl_certificate.py
  3. +2
    -0
      tests/functional/transport/pecan/controllers/test_ssl_certificate.py

+ 2
- 1
poppy/transport/pecan/models/response/ssl_certificate.py View File

@@ -22,7 +22,7 @@ from poppy.common import util

class Model(collections.OrderedDict):

'response class for SSLCertificate'
"""response class for SSLCertificate."""

def __init__(self, ssl_certificate):
super(Model, self).__init__()
@@ -31,3 +31,4 @@ class Model(collections.OrderedDict):
self['cert_type'] = ssl_certificate.cert_type
self['cert_details'] = ssl_certificate.cert_details
self['status'] = ssl_certificate.get_cert_status()
self['project_id'] = ssl_certificate.project_id

+ 1
- 0
tests/api/ssl_certificate/test_create_ssl_certificate.py View File

@@ -78,6 +78,7 @@ class TestCreateSSLCertificate(base.TestBase):
self.assertEqual(cert['domain_name'], self.domain_name)
self.assertEqual(cert['flavor_id'], flavor_id)
self.assertEqual(cert['cert_type'], self.cert_type)
self.assertEqual(cert['project_id'], project_id)

def tearDown(self):
# Do not call delete cert for negative test


+ 2
- 0
tests/functional/transport/pecan/controllers/test_ssl_certificate.py View File

@@ -109,6 +109,8 @@ class SSLCertificateControllerTest(base.FunctionalTest):
response_list[0]["domain_name"])
self.assertEqual(ssl_certificate_json["flavor_id"],
response_list[0]["flavor_id"])
self.assertEqual(ssl_certificate_json["project_id"],
response_list[0]["project_id"])

def test_get_ssl_certificate_existing_domain_different_project_id(self):
domain = 'www.iexist.com'


Loading…
Cancel
Save