Changeset 1172
- Timestamp:
- 06/28/06 21:28:45
- Files:
-
- trunk/cherrypy/_cptools.py (modified) (1 diff)
- trunk/cherrypy/test/test_xmlrpc.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/_cptools.py
r1171 r1172 204 204 for attr in str(rpcmethod).split('.'): 205 205 subhandler = getattr(subhandler, attr, None) 206 if subhandler is None: 207 raise cherrypy.NotFound() 208 if not getattr(subhandler, "exposed", False): 209 raise cherrypy.NotFound() 210 211 body = subhandler(*(vpath + rpcparams), **params) 206 207 if subhandler and getattr(subhandler, "exposed", False): 208 body = subhandler(*(vpath + rpcparams), **params) 209 210 else: 211 # http://www.cherrypy.org/ticket/533 212 # if a method is not found, an xmlrpclib.Fault should be returned 213 # raising an exception here will do that; see 214 # cherrypy.lib.xmlrpc.on_error 215 raise Exception, 'method "%s" is not supported' % attr 216 212 217 conf = cherrypy.request.toolmap.get("xmlrpc", {}) 213 218 _xmlrpc.respond(body, trunk/cherrypy/test/test_xmlrpc.py
r1134 r1172 100 100 self.fail("Expected xmlrpclib.Fault") 101 101 102 # http://www.cherrypy.org/ticket/533 103 # if a method is not found, an xmlrpclib.Fault should be raised 104 try: 105 proxy.non_method() 106 except Exception, x: 107 self.assertEqual(x.__class__, xmlrpclib.Fault) 108 self.assertEqual(x.faultString, 'method "non_method" is not supported') 109 else: 110 self.fail("Expected xmlrpclib.Fault") 111 102 112 103 113 if __name__ == '__main__':

