def discover_extensions(openid_url): service = discover(openid_url) use_ax = False use_sreg = False for endpoint in service[1]: if not use_sreg: use_sreg = sreg.supportsSReg(endpoint) if not use_ax: use_ax = endpoint.usesExtension("http://openid.net/srv/ax/1.0") if use_ax and use_sreg: break return use_ax, use_sreg
def test_supported_1_0(self): endpoint = FakeEndpoint([sreg.ns_uri_1_0]) self.failUnless(sreg.supportsSReg(endpoint)) self.failUnlessEqual([sreg.ns_uri_1_1, sreg.ns_uri_1_0], endpoint.checked_uris)
def test_supported_1_0(self): endpoint = FakeEndpoint([sreg.ns_uri_1_0]) self.assertTrue(sreg.supportsSReg(endpoint)) self.assertEqual(endpoint.checked_uris, [sreg.ns_uri_1_1, sreg.ns_uri_1_0])
def test_unsupported(self): endpoint = FakeEndpoint([]) self.assertFalse(sreg.supportsSReg(endpoint)) self.assertEqual([sreg.ns_uri_1_1, sreg.ns_uri_1_0], endpoint.checked_uris)