Changeset 1297
- Timestamp:
- 08/29/06 13:53:37
- Files:
-
- trunk/cherrypy/test/test_objectmapping.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/test/test_objectmapping.py
r1278 r1297 103 103 default.exposed = True 104 104 105 # MethodDispatcher code 105 106 class ByMethod: 106 107 exposed = True … … 114 115 def POST(self, thing): 115 116 self.things.append(thing) 117 118 class Collection: 119 default = ByMethod('a', 'bit') 116 120 117 121 Root.exposing = Exposing() … … 123 127 Root.defnoindex = DefNoIndex() 124 128 Root.bymethod = ByMethod('another') 129 Root.collection = Collection() 125 130 126 131 for url in script_names: … … 128 133 conf = {'/': {'user': (url or "/").split("/")[-2]}, 129 134 '/bymethod': {'request.dispatch': d}, 135 '/collection': {'request.dispatch': d}, 130 136 } 131 137 cherrypy.tree.mount(Root(), url, conf) … … 276 282 self.assertErrorPage(405) 277 283 self.assertHeader('Allow', 'GET, HEAD, POST') 284 285 # Test default with posparams 286 self.getPage("/collection/silly", method="POST") 287 self.getPage("/collection", method="GET") 288 self.assertBody("['a', 'bit', 'silly']") 278 289 279 290

