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
1=== modified file 'src/ubuntu_sso_saml/tests/test_models.py'
2--- src/ubuntu_sso_saml/tests/test_models.py 2017-12-05 17:00:54 +0000
3+++ src/ubuntu_sso_saml/tests/test_models.py 2018-01-09 19:46:14 +0000
4@@ -83,8 +83,7 @@
5 ["'certificate' must be a PEM-formatted X.509 certificate."])
6
7 def test_validate_cert_valid(self):
8- path = find_cert_path()
9- cert_filename = path + 'certificate.pem'
10+ cert_filename = find_cert_path('certificate.pem')
11 with open(cert_filename) as cert_file:
12 cert_data = cert_file.read()
13 try:
14
15=== modified file 'src/ubuntu_sso_saml/tests/test_views.py'
16--- src/ubuntu_sso_saml/tests/test_views.py 2018-01-09 19:46:14 +0000
17+++ src/ubuntu_sso_saml/tests/test_views.py 2018-01-09 19:46:14 +0000
18@@ -19,9 +19,8 @@
19 new_saml2idp_config = copy.deepcopy(saml2idp_metadata.SAML2IDP_CONFIG)
20 self.patch(saml2idp_metadata, 'SAML2IDP_CONFIG',
21 new=new_saml2idp_config)
22- path = find_cert_path()
23- cert_file = path + 'certificate.pem'
24- priv_file = path + 'private-key.pem'
25+ cert_file = find_cert_path('certificate.pem')
26+ priv_file = find_cert_path('private-key.pem')
27 test_config = {
28 'certificate_file': cert_file,
29 'private_key_file': priv_file,