예제 #1
0
 def test_verify_consent(self):
     consent_config = SATOSAConfig(self.satosa_config)
     consent_module = ConsentModule(consent_config, lambda: None)
     consent_id = "1234"
     responses.add(responses.GET,
                   "{}/verify/{}".format(consent_config.CONSENT["rest_uri"], consent_id),
                   status=200, body=json.dumps(FILTER))
     assert consent_module._verify_consent(consent_id) == FILTER
예제 #2
0
    def test_verify_consent_false_on_http_400(self):
        consent_config = SATOSAConfig(self.satosa_config)
        consent_module = ConsentModule(consent_config, lambda: None)

        consent_id = "1234"
        responses.add(responses.GET,
                      "{}/verify/{}".format(consent_config.CONSENT["rest_uri"], consent_id),
                      status=400)
        assert not consent_module._verify_consent(consent_id)
예제 #3
0
 def test_verify_consent(self):
     consent_config = SATOSAConfig(self.satosa_config)
     consent_module = ConsentModule(consent_config, lambda: None)
     consent_id = "1234"
     responses.add(responses.GET,
                   "{}/verify/{}".format(consent_config.CONSENT["rest_uri"],
                                         consent_id),
                   status=200,
                   body=json.dumps(FILTER))
     assert consent_module._verify_consent(consent_id) == FILTER
예제 #4
0
    def test_verify_consent_false_on_http_400(self):
        consent_config = SATOSAConfig(self.satosa_config)
        consent_module = ConsentModule(consent_config, lambda: None)

        consent_id = "1234"
        responses.add(responses.GET,
                      "{}/verify/{}".format(consent_config.CONSENT["rest_uri"],
                                            consent_id),
                      status=400)
        assert not consent_module._verify_consent(consent_id)