Skip to content

Commit

Permalink
coverage
Browse files Browse the repository at this point in the history
mcdonc committed Sep 10, 2012
1 parent e0b86f9 commit 27d874a
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions pyramid/tests/test_traversal.py
Original file line number Diff line number Diff line change
@@ -128,10 +128,23 @@ def test_instance_conforms_to_ITraverser(self):
context = DummyContext()
verifyObject(ITraverser, self._makeOne(context))

def test_call_with_no_pathinfo(self):
def test_call_with_empty_pathinfo(self):
policy = self._makeOne(None)
environ = self._getEnviron()
request = DummyRequest(environ)
request = DummyRequest(environ, path_info='')
result = policy(request)
self.assertEqual(result['context'], None)
self.assertEqual(result['view_name'], '')
self.assertEqual(result['subpath'], ())
self.assertEqual(result['traversed'], ())
self.assertEqual(result['root'], policy.root)
self.assertEqual(result['virtual_root'], policy.root)
self.assertEqual(result['virtual_root_path'], ())

def test_call_with_pathinfo_KeyError(self):
policy = self._makeOne(None)
environ = self._getEnviron()
request = DummyRequest(environ, toraise=KeyError)
result = policy(request)
self.assertEqual(result['context'], None)
self.assertEqual(result['view_name'], '')

0 comments on commit 27d874a

Please sign in to comment.