예제 #1
0
    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)
예제 #2
0
    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)
예제 #3
0
 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"
예제 #4
0
 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"