Merge lp:~roadmr/canonical-identity-provider/find-cert-path-with-filename-everywhere into lp:canonical-identity-provider/release

Proposed by Daniel Manrique
Status: Merged
Approved by: Daniel Manrique
Approved revision: no longer in the source branch.
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: lp:~roadmr/canonical-identity-provider/find-cert-path-with-filename-everywhere
Merge into: lp:canonical-identity-provider/release
Prerequisite: lp:~roadmr/canonical-identity-provider/metadata-with-custom-cert
Diff against target: 29 lines (+3/-5)
2 files modified
src/ubuntu_sso_saml/tests/test_models.py (+1/-2)
src/ubuntu_sso_saml/tests/test_views.py (+2/-3)
To merge this branch: bzr merge lp:~roadmr/canonical-identity-provider/find-cert-path-with-filename-everywhere
Reviewer Review Type Date Requested Status
Maximiliano Bertacchini Approve
Review via email: mp+335190@code.launchpad.net

Commit message

Consistently use find_cert_path's auto-append-filename capabilities

Description of the change

Consistently use find_cert_path's auto-append-filename capabilities.
Results in a net savings of *2* lines of code :)

To post a comment you must log in.
Revision history for this message
Maximiliano Bertacchini (maxiberta) wrote :

+1!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/ubuntu_sso_saml/tests/test_models.py'
--- src/ubuntu_sso_saml/tests/test_models.py 2017-12-05 17:00:54 +0000
+++ src/ubuntu_sso_saml/tests/test_models.py 2018-01-09 19:46:14 +0000
@@ -83,8 +83,7 @@
83 ["'certificate' must be a PEM-formatted X.509 certificate."])83 ["'certificate' must be a PEM-formatted X.509 certificate."])
8484
85 def test_validate_cert_valid(self):85 def test_validate_cert_valid(self):
86 path = find_cert_path()86 cert_filename = find_cert_path('certificate.pem')
87 cert_filename = path + 'certificate.pem'
88 with open(cert_filename) as cert_file:87 with open(cert_filename) as cert_file:
89 cert_data = cert_file.read()88 cert_data = cert_file.read()
90 try:89 try:
9190
=== modified file 'src/ubuntu_sso_saml/tests/test_views.py'
--- src/ubuntu_sso_saml/tests/test_views.py 2018-01-09 19:46:14 +0000
+++ src/ubuntu_sso_saml/tests/test_views.py 2018-01-09 19:46:14 +0000
@@ -19,9 +19,8 @@
19 new_saml2idp_config = copy.deepcopy(saml2idp_metadata.SAML2IDP_CONFIG)19 new_saml2idp_config = copy.deepcopy(saml2idp_metadata.SAML2IDP_CONFIG)
20 self.patch(saml2idp_metadata, 'SAML2IDP_CONFIG',20 self.patch(saml2idp_metadata, 'SAML2IDP_CONFIG',
21 new=new_saml2idp_config)21 new=new_saml2idp_config)
22 path = find_cert_path()22 cert_file = find_cert_path('certificate.pem')
23 cert_file = path + 'certificate.pem'23 priv_file = find_cert_path('private-key.pem')
24 priv_file = path + 'private-key.pem'
25 test_config = {24 test_config = {
26 'certificate_file': cert_file,25 'certificate_file': cert_file,
27 'private_key_file': priv_file,26 'private_key_file': priv_file,