Package openid :: Package test :: Module test_services
[frames] | no frames]

Source Code for Module openid.test.test_services

 1  import unittest 
 2   
 3  from openid.yadis import services 
 4  from openid.yadis.discover import DiscoveryFailure, DiscoveryResult 
 5   
 6   
7 -class TestGetServiceEndpoints(unittest.TestCase):
8 - def setUp(self):
9 self.orig_discover = services.discover 10 services.discover = self.discover
11
12 - def tearDown(self):
13 services.discover = self.orig_discover
14
15 - def discover(self, input_url):
16 result = DiscoveryResult(input_url) 17 result.response_text = "This is not XRDS text." 18 return result
19
20 - def test_catchXRDSError(self):
21 self.failUnlessRaises(DiscoveryFailure, 22 services.getServiceEndpoints, 23 "http://example.invalid/sometest")
24