def test_url_extra_slashes(self):
        util.setup_expected_instance_discovery_request(
            200, cp['authorityHosts']['global'],
            {'tenant_discovery_endpoint': 'http://foobar'},
            self.nonHardCodedAuthorizeEndpoint)

        authority_url = self.nonHardCodedAuthority + '/'  # This should pass for one or more than one slashes
        authority = Authority(authority_url, True)
        obj = util.create_empty_adal_object()
        authority.validate(obj['call_context'])
        req = httpretty.last_request()
        util.match_standard_request_headers(req)
    def test_url_extra_path_elements(self):
        util.setup_expected_instance_discovery_request(
            200,
            cp["authorityHosts"]["global"],
            {"tenant_discovery_endpoint": "http://foobar"},
            self.nonHardCodedAuthorizeEndpoint,
        )

        authority_url = self.nonHardCodedAuthority + "/extra/path"
        authority = Authority(authority_url, True)
        obj = util.create_empty_adal_object()

        authority.validate(obj["call_context"])
        req = httpretty.last_request()
        util.match_standard_request_headers(req)
コード例 #3
0
    def test_url_extra_path_elements(self):
        util.setup_expected_instance_discovery_request(200,
            cp['authorityHosts']['global'],
            {
                'tenant_discovery_endpoint' : 'http://foobar'
            },
            self.nonHardCodedAuthorizeEndpoint)

        authority_url = self.nonHardCodedAuthority + '/extra/path'
        authority = Authority(authority_url, True)
        obj = util.create_empty_adal_object()

        def callback(err):
            if err:
                self.assertFalse(err, 'Received unexpected error: ' + err.args[0])
            req = httpretty.last_request()
            util.match_standard_request_headers(req)

        authority.validate(obj['call_context'], callback)