diff options
author | Mantas <sirexas@gmail.com> | 2020-09-29 16:11:15 +0300 |
---|---|---|
committer | Marcel Hellkamp <marc@gsites.de> | 2020-12-31 16:34:08 +0100 |
commit | cf53eabff29edf3f5486c551fb3e6a510e641a29 (patch) | |
tree | 96062ddeb14ffd2f0a1d3566600ac812bbc557c8 | |
parent | 207d51d9a3bb2ae7a9732a686355ab89acc38ac7 (diff) | |
download | bottle-cf53eabff29edf3f5486c551fb3e6a510e641a29.tar.gz |
Add tests for #602 bug
It looks that #602 is gone, but I'm not sure when exactly it was fixed.
I see that there is a suspicious change [here](https://github.com/bottlepy/bottle/commit/d85a6983ceedacd9ab9afbcd027139d8773b67ac):
environ['PATH_INFO'] = path.encode('latin1').decode('utf8', 'ignore')
Where original cause of the error was removed and replaced by `'ignore'`.
Also fixed deprecation warnings, where:
@self.subapp.route('')
Does exactly same thing as this:
@self.subapp.route('/test/<test>')
Where `''` is passed to `route()`, then `makelist()` utility assumes that nothing is passed and falls back to path autogeneration from callbackf unction. Not sure if this is expected behaviour?
-rw-r--r-- | test/test_mount.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/test_mount.py b/test/test_mount.py index 582c087..1fbef40 100644 --- a/test/test_mount.py +++ b/test/test_mount.py @@ -6,12 +6,17 @@ class TestAppMounting(ServerTestBase): def setUp(self): ServerTestBase.setUp(self) self.subapp = bottle.Bottle() - @self.subapp.route('') + @self.subapp.route('/') - @self.subapp.route('/test/:test') + @self.subapp.route('/test/<test>') def test(test='foo'): return test + def test_mount_unicode_path_bug602(self): + self.app.mount('/mount/', self.subapp) + self.assertBody('äöü', '/mount/test/äöü') + self.app.route('/route/<param>', callback=lambda param: param) + self.assertBody('äöü', '/route/äöü') def test_mount_order_bug581(self): self.app.mount('/test/', self.subapp) |