(self)
| 346 | ) |
| 347 | |
| 348 | def testUnload(self): |
| 349 | x = web.storage(a=0) |
| 350 | |
| 351 | # fmt: off |
| 352 | urls = ( |
| 353 | "/foo", "foo", |
| 354 | "/bar", "bar" |
| 355 | ) |
| 356 | # fmt: on |
| 357 | |
| 358 | class foo: |
| 359 | def GET(self): |
| 360 | return "foo" |
| 361 | |
| 362 | class bar: |
| 363 | def GET(self): |
| 364 | raise web.notfound() |
| 365 | |
| 366 | app = web.application(urls, locals()) |
| 367 | |
| 368 | def unload(): |
| 369 | x.a += 1 |
| 370 | |
| 371 | app.add_processor(web.unloadhook(unload)) |
| 372 | |
| 373 | app.request("/foo") |
| 374 | self.assertEqual(x.a, 1) |
| 375 | |
| 376 | app.request("/bar") |
| 377 | self.assertEqual(x.a, 2) |
| 378 | |
| 379 | def test_changequery(self): |
| 380 | urls = ("/", "index") |
nothing calls this directly
no test coverage detected