Fix path checks in some tests.

When running ./setup.py test, these two tests were failing to find the
.pem files located in the tests/ directory that they were referencing
without paths.

Other tests use full_path from pathutils to reference files in tests/,
so adjusted these to do similarly, and now they pass.
This commit is contained in:
Hank Leininger 2014-04-04 00:05:01 -04:00
parent f64dc8e050
commit 93fdb1edc3
Failed to extract signature
2 changed files with 5 additions and 3 deletions

View File

@ -4,6 +4,7 @@ from saml2.sigver import pre_encryption_part, ASSERT_XPATH, EncryptError
from saml2.sigver import CryptoBackendXmlSec1
from saml2.sigver import pre_encrypt_assertion
from pathutils import xmlsec_path
from pathutils import full_path
__author__ = 'roland'
@ -65,7 +66,7 @@ def test_enc1():
# data_file.close()
key_type = "des-192"
com_list = [xmlsec_path, "encrypt", "--pubkey-cert-pem", "pubkey.pem",
com_list = [xmlsec_path, "encrypt", "--pubkey-cert-pem", full_path("pubkey.pem"),
"--session-key", key_type, "--xml-data", data,
"--node-xpath", ASSERT_XPATH]
@ -89,7 +90,7 @@ def test_enc2():
IDENTITY, "id12", "http://lingon.catalogix.se:8087/",
"urn:mace:example.com:saml:roland:sp", name_id=name_id)
enc_resp = crypto.encrypt_assertion(resp_, "pubkey.pem",
enc_resp = crypto.encrypt_assertion(resp_, full_path("pubkey.pem"),
pre_encryption_part())
print enc_resp

View File

@ -9,6 +9,7 @@ from saml2.extension.pefim import SPCertEnc
from saml2.samlp import Extensions
from saml2.samlp import authn_request_from_string
from saml2.sigver import read_cert_from_file
from pathutils import full_path
__author__ = 'roland'
@ -17,7 +18,7 @@ conf.load_file("server_conf")
client = Saml2Client(conf)
# place a certificate in an authn request
cert = read_cert_from_file("test.pem", "pem")
cert = read_cert_from_file(full_path("test.pem"), "pem")
spcertenc = SPCertEnc(
x509_data=ds.X509Data(