summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbottle.py1
-rw-r--r--test/test_mount.py28
2 files changed, 29 insertions, 0 deletions
diff --git a/bottle.py b/bottle.py
index c61477c..d17dc9a 100755
--- a/bottle.py
+++ b/bottle.py
@@ -434,6 +434,7 @@ class Bottle(object):
raise TypeError('Conflict with existing mount: %s' % other)
path_depth = prefix.count('/') + 1
options.setdefault('method', 'ANY')
+ options.setdefault('skip', True)
self.mounts[prefix] = app
@self.route('/%s/:#.*#' % prefix, **options)
def mountpoint():
diff --git a/test/test_mount.py b/test/test_mount.py
new file mode 100644
index 0000000..13af7a6
--- /dev/null
+++ b/test/test_mount.py
@@ -0,0 +1,28 @@
+import unittest
+import sys, os.path
+import bottle
+import urllib2
+from StringIO import StringIO
+import thread
+import time
+from tools import ServerTestBase
+from bottle import tob, touni, tonat, Bottle
+
+class TestWsgi(ServerTestBase):
+ ''' Tests sub-application support. '''
+
+ def test_mount_no_plugins(self):
+ def plugin(func):
+ def wrapper(*a, **ka):
+ return 'Plugin'
+ return wrapper
+ self.app.install(plugin)
+ app = Bottle()
+ self.app.mount(app, '/prefix')
+ app.route('/foo', callback=lambda: 'bar')
+ self.app.route('/foo', callback=lambda: 'baz')
+ self.assertBody('Plugin', '/foo')
+ self.assertBody('bar', '/prefix/foo')
+
+if __name__ == '__main__': #pragma: no cover
+ unittest.main()