summaryrefslogtreecommitdiff
path: root/repoze
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2010-09-05 23:39:30 +0000
committerChris McDonough <chrism@agendaless.com>2010-09-05 23:39:30 +0000
commit8deae21c801bc05c6464a6eead3df449ed1fe52d (patch)
tree821fc7224a8764373a16be5e6ea59872e8a2d333 /repoze
parentd3c39db1c24a603dff710f1f187d435acf6a6752 (diff)
downloadpyramid-8deae21c801bc05c6464a6eead3df449ed1fe52d.tar.gz
pyramid-8deae21c801bc05c6464a6eead3df449ed1fe52d.tar.bz2
pyramid-8deae21c801bc05c6464a6eead3df449ed1fe52d.zip
- The route pattern registered internally for a a local "static view"
(either via the ``static`` ZCML directive or via the ``add_static_view`` method of the configurator) was incorrect. It was regsistered for e.g. ``static*traverse``, while it should have been registered for ``static/*traverse``. Symptom: two static views could not reliably be added to a system when they both shared the same path prefix (e.g. ``/static`` and ``/static2``).
Diffstat (limited to 'repoze')
-rw-r--r--repoze/bfg/static.py2
-rw-r--r--repoze/bfg/tests/test_configuration.py2
-rw-r--r--repoze/bfg/tests/test_static.py2
-rw-r--r--repoze/bfg/tests/test_zcml.py2
4 files changed, 4 insertions, 4 deletions
diff --git a/repoze/bfg/static.py b/repoze/bfg/static.py
index 36a855dfb..5effd4e4b 100644
--- a/repoze/bfg/static.py
+++ b/repoze/bfg/static.py
@@ -126,7 +126,7 @@ class StaticURLInfo(object):
# register a route using this view
self.config.add_route(
name,
- "%s*subpath" % name,
+ "%s/*subpath" % name,
view=view,
view_for=self.__class__,
factory=lambda *x: self,
diff --git a/repoze/bfg/tests/test_configuration.py b/repoze/bfg/tests/test_configuration.py
index be9cd942c..5c677fdcd 100644
--- a/repoze/bfg/tests/test_configuration.py
+++ b/repoze/bfg/tests/test_configuration.py
@@ -1970,7 +1970,7 @@ class ConfiguratorTests(unittest.TestCase):
config = self._makeOne()
config.add_static_view('static', 'fixtures/static')
request_type = self._getRouteRequestIface(config, 'static')
- route = self._assertRoute(config, 'static', 'static*subpath')
+ route = self._assertRoute(config, 'static', 'static/*subpath')
self.assertEqual(route.factory.__class__, type(lambda x: x))
iface = implementedBy(StaticURLInfo)
wrapped = config.registry.adapters.lookup(
diff --git a/repoze/bfg/tests/test_static.py b/repoze/bfg/tests/test_static.py
index 508db0d90..d9893ab2f 100644
--- a/repoze/bfg/tests/test_static.py
+++ b/repoze/bfg/tests/test_static.py
@@ -311,7 +311,7 @@ class TestStaticURLInfo(unittest.TestCase):
inst.add('view', 'anotherpackage:path', cache_max_age=1)
expected = [('view', 'anotherpackage:path', False)]
self.assertEqual(inst.registrations, expected)
- self.assertEqual(config.arg, ('view', 'view*subpath'))
+ self.assertEqual(config.arg, ('view', 'view/*subpath'))
self.assertEqual(config.kw['_info'], None)
self.assertEqual(config.kw['view_for'], self._getTargetClass())
self.assertEqual(config.kw['factory'](), inst)
diff --git a/repoze/bfg/tests/test_zcml.py b/repoze/bfg/tests/test_zcml.py
index d7282551d..799826d1b 100644
--- a/repoze/bfg/tests/test_zcml.py
+++ b/repoze/bfg/tests/test_zcml.py
@@ -706,7 +706,7 @@ class TestStaticDirective(unittest.TestCase):
mapper = reg.getUtility(IRoutesMapper)
routes = mapper.get_routes()
self.assertEqual(len(routes), 1)
- self.assertEqual(routes[0].path, 'name*subpath')
+ self.assertEqual(routes[0].path, 'name/*subpath')
self.assertEqual(routes[0].name, 'name')
view_action = actions[1]