summaryrefslogtreecommitdiff
path: root/repoze/bfg/tests
diff options
context:
space:
mode:
authorTres Seaver <tseaver@palladion.com>2009-04-29 21:34:09 +0000
committerTres Seaver <tseaver@palladion.com>2009-04-29 21:34:09 +0000
commit21707020158f1c161c402776148436ce82c7c5b6 (patch)
tree5357c541a4479f7fc22a2126c51376f885d7c7d3 /repoze/bfg/tests
parent67b5b39d0510d1485593c92579e98a3f7a8f29ce (diff)
downloadpyramid-21707020158f1c161c402776148436ce82c7c5b6.tar.gz
pyramid-21707020158f1c161c402776148436ce82c7c5b6.tar.bz2
pyramid-21707020158f1c161c402776148436ce82c7c5b6.zip
Drop the ILocation testing by default during traversal.
Diffstat (limited to 'repoze/bfg/tests')
-rw-r--r--repoze/bfg/tests/test_traversal.py38
1 files changed, 22 insertions, 16 deletions
diff --git a/repoze/bfg/tests/test_traversal.py b/repoze/bfg/tests/test_traversal.py
index 18e9a9f18..3354dcce1 100644
--- a/repoze/bfg/tests/test_traversal.py
+++ b/repoze/bfg/tests/test_traversal.py
@@ -173,6 +173,28 @@ class ModelGraphTraverserTests(unittest.TestCase):
self.assertEqual(vroot, bar)
self.assertEqual(vroot_path, [u'foo', u'bar'])
+ def test_non_utf8_path_segment_unicode_path_segments_fails(self):
+ foo = DummyContext()
+ root = DummyContext(foo)
+ policy = self._makeOne(root)
+ segment = unicode('LaPe\xc3\xb1a', 'utf-8').encode('utf-16')
+ environ = self._getEnviron(PATH_INFO='/%s' % segment)
+ self.assertRaises(TypeError, policy, environ)
+
+ def test_non_utf8_path_segment_settings_unicode_path_segments_fails(self):
+ foo = DummyContext()
+ root = DummyContext(foo)
+ policy = self._makeOne(root)
+ segment = unicode('LaPe\xc3\xb1a', 'utf-8').encode('utf-16')
+ environ = self._getEnviron(PATH_INFO='/%s' % segment)
+ self.assertRaises(TypeError, policy, environ)
+
+class WrappingModelGraphTraverserTests(ModelGraphTraverserTests):
+
+ def _getTargetClass(self):
+ from repoze.bfg.traversal import WrappingModelGraphTraverser
+ return WrappingModelGraphTraverser
+
def test_call_with_ILocation_root_proxies(self):
baz = DummyContext()
bar = DummyContext(baz)
@@ -240,22 +262,6 @@ class ModelGraphTraverserTests(unittest.TestCase):
self.assertEqual(vroot, root)
self.assertEqual(vroot_path, [])
- def test_non_utf8_path_segment_unicode_path_segments_fails(self):
- foo = DummyContext()
- root = DummyContext(foo)
- policy = self._makeOne(root)
- segment = unicode('LaPe\xc3\xb1a', 'utf-8').encode('utf-16')
- environ = self._getEnviron(PATH_INFO='/%s' % segment)
- self.assertRaises(TypeError, policy, environ)
-
- def test_non_utf8_path_segment_settings_unicode_path_segments_fails(self):
- foo = DummyContext()
- root = DummyContext(foo)
- policy = self._makeOne(root)
- segment = unicode('LaPe\xc3\xb1a', 'utf-8').encode('utf-16')
- environ = self._getEnviron(PATH_INFO='/%s' % segment)
- self.assertRaises(TypeError, policy, environ)
-
class FindInterfaceTests(unittest.TestCase):
def _callFUT(self, context, iface):
from repoze.bfg.traversal import find_interface