def test_consent_registration_raises_on_http401(self): consent_config = SATOSAConfig(self.satosa_config) consent_module = ConsentModule(consent_config, lambda: None) jws = "A_JWS" responses.add(responses.GET, "{}/creq/{}".format(consent_config.CONSENT["rest_uri"], jws), status=401) with pytest.raises(AssertionError): consent_module._consent_registration(jws)
def test_consent_registration_raises_on_http401(self): consent_config = SATOSAConfig(self.satosa_config) consent_module = ConsentModule(consent_config, lambda: None) jws = "A_JWS" responses.add(responses.GET, "{}/creq/{}".format(consent_config.CONSENT["rest_uri"], jws), status=401) with pytest.raises(AssertionError): consent_module._consent_registration(jws)
def test_consent_registration(self): consent_config = SATOSAConfig(self.satosa_config) consent_module = ConsentModule(consent_config, lambda: None) jws = "A_JWS" responses.add(responses.GET, "{}/creq/{}".format(consent_config.CONSENT["rest_uri"], jws), status=200, body="ticket") assert consent_module._consent_registration(jws) == "ticket"
def test_consent_registration(self): consent_config = SATOSAConfig(self.satosa_config) consent_module = ConsentModule(consent_config, lambda: None) jws = "A_JWS" responses.add(responses.GET, "{}/creq/{}".format(consent_config.CONSENT["rest_uri"], jws), status=200, body="ticket") assert consent_module._consent_registration(jws) == "ticket"