(self)
| 411 | self.assertEqual(f("/admin"), "foo=bar; Path=/admin/") |
| 412 | |
| 413 | def test_stopsimpleserver(self): |
| 414 | urls = ("/", "index") |
| 415 | |
| 416 | class index: |
| 417 | def GET(self): |
| 418 | pass |
| 419 | |
| 420 | # reset command-line arguments |
| 421 | sys.argv = ["code.py"] |
| 422 | |
| 423 | app = web.application(urls, locals()) |
| 424 | thread = threading.Thread(target=app.run) |
| 425 | |
| 426 | thread.start() |
| 427 | time.sleep(1) |
| 428 | self.assertTrue(thread.is_alive()) |
| 429 | |
| 430 | app.stop() |
| 431 | thread.join(timeout=1) |
| 432 | self.assertFalse(thread.is_alive()) |