示例#1
0
    def runTest(self):
        # Parse into endpoint objects that we will check
        endpoints = applyFilter(self.yadis_url, self.xrds,
                                OpenIDServiceEndpoint)

        # make sure there are the same number of endpoints as
        # URIs. This assumes that the type_uris contains at least one
        # OpenID type.
        self.failUnlessEqual(len(self.uris), len(endpoints))

        # So that we can check equality on the endpoint types
        type_uris = list(self.type_uris)
        type_uris.sort()

        seen_uris = []
        for endpoint in endpoints:
            seen_uris.append(endpoint.server_url)

            # All endpoints will have same yadis_url
            self.failUnlessEqual(self.yadis_url, endpoint.claimed_id)

            # and local_id
            self.failUnlessEqual(self.local_id, endpoint.local_id)

            # and types
            actual_types = list(endpoint.type_uris)
            actual_types.sort()
            self.failUnlessEqual(actual_types, type_uris)

        # So that they will compare equal, because we don't care what
        # order they are in
        seen_uris.sort()
        uris = list(self.uris)
        uris.sort()

        # Make sure we saw all URIs, and saw each one once
        self.failUnlessEqual(uris, seen_uris)
示例#2
0
    def runTest(self):
        # Parse into endpoint objects that we will check
        endpoints = applyFilter(
            self.yadis_url, self.xrds, OpenIDServiceEndpoint)

        # make sure there are the same number of endpoints as
        # URIs. This assumes that the type_uris contains at least one
        # OpenID type.
        self.failUnlessEqual(len(self.uris), len(endpoints))

        # So that we can check equality on the endpoint types
        type_uris = list(self.type_uris)
        type_uris.sort()

        seen_uris = []
        for endpoint in endpoints:
            seen_uris.append(endpoint.server_url)

            # All endpoints will have same yadis_url
            self.failUnlessEqual(self.yadis_url, endpoint.claimed_id)

            # and local_id
            self.failUnlessEqual(self.local_id, endpoint.local_id)

            # and types
            actual_types = list(endpoint.type_uris)
            actual_types.sort()
            self.failUnlessEqual(actual_types, type_uris)

        # So that they will compare equal, because we don't care what
        # order they are in
        seen_uris.sort()
        uris = list(self.uris)
        uris.sort()

        # Make sure we saw all URIs, and saw each one once
        self.failUnlessEqual(uris, seen_uris)
示例#3
0
 def _getServices(self, flt=None):
     return list(services.applyFilter(self.yadis_url, self.xmldoc, flt))
示例#4
0
 def _getServices(self, flt=None):
     return list(services.applyFilter(self.yadis_url, self.xmldoc, flt))