diff --git a/src/spid_sp_test/__init__.py b/src/spid_sp_test/__init__.py index b308c2d..2317228 100644 --- a/src/spid_sp_test/__init__.py +++ b/src/spid_sp_test/__init__.py @@ -6,7 +6,7 @@ BASE_DIR = Path(__file__).resolve().parent -__version__ = "1.2.16" +__version__ = "1.2.17" __name__ = "spid_sp_test" logger = logging.getLogger(__name__) diff --git a/tests/test_02_authn.py b/tests/test_02_authn.py index fe301ba..ca482c4 100644 --- a/tests/test_02_authn.py +++ b/tests/test_02_authn.py @@ -5,18 +5,17 @@ CMD = BASE_CMD + " --extra --metadata-url file://tests/metadata/{} --authn-url file://tests/authn/{} --debug ERROR" -def run_cmd(mfname, metadata = BASE_METADATA, profile="spid-sp-public") -> int: +def run_cmd(mfname, metadata = BASE_METADATA, profile="spid-sp-public", environ="") -> int: cmd = CMD.format(metadata, mfname) - return os.system(f'{cmd} --profile {profile}') - + return os.system(f'{environ}{cmd} --profile {profile}') def test_django_post_html(): - es = run_cmd('spid_django_post.html') + es = run_cmd('spid_django_post.html', environ="IDP_ENTITYID=https://localhost:8080 ") assert es == 0 def test_django_post(): - es = run_cmd('spid_django.xml') + es = run_cmd('spid_django.xml', environ="IDP_ENTITYID=https://localhost:8080 ") assert es == 0 @@ -25,19 +24,22 @@ def test_django_redirect(): Must fail ERROR:spid_sp_test.authn_request:The ProtocolBinding attribute must be urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST - TR pag. 8 : FAILED """ - es = run_cmd('spid_django_redirect.url') + es = run_cmd('spid_django_redirect.url', environ="IDP_ENTITYID=https://localhost:8080 ") assert es != 0 + def test_spid_express_no_relaystate(): """Must fail""" es = run_cmd("spid_express_no_relaystate_redirect.url", metadata = "spid_express_no_relaystate_metadata.xml") assert es != 0 + def test_django_post_wrong_signature(): es = run_cmd('spid_django_wrong_signature.xml') assert es != 0 + def test_L2(): """Must fail""" es = run_cmd("tests/authn/spid_express_forceauthn_spid_level_2.url", diff --git a/tests/test_03_responses.py b/tests/test_03_responses.py index 1ff0402..48ab07a 100644 --- a/tests/test_03_responses.py +++ b/tests/test_03_responses.py @@ -4,5 +4,5 @@ def test_all_default_responses(): - es = os.system(CMD) + es = os.system(f"IDP_ENTITYID=https://localhost:8080 {CMD}") assert es == 0