<s> import unittest <EOL> from openid . yadis import services <EOL> from openid . yadis . discover import DiscoveryFailure , DiscoveryResult <EOL> class TestGetServiceEndpoints ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . orig_discover = services . discover <EOL> services . discover = self . discover <EOL> def tearDown ( self ) : <EOL> services . discover = self . orig_discover <EOL> def discover ( self , input_url ) : <EOL> result = DiscoveryResult ( input_url ) <EOL> result . response_text = "<STR_LIT>" <EOL> return result <EOL> def test_catchXRDSError ( self ) : <EOL> self . failUnlessRaises ( DiscoveryFailure , <EOL> services . getServiceEndpoints , <EOL> "<STR_LIT>" ) </s>
