summaryrefslogtreecommitdiff
path: root/test/test_mount.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_mount.py')
-rw-r--r--test/test_mount.py28
1 files changed, 28 insertions, 0 deletions
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()