def test_missing_skin(self): from zope.traversing.namespace import skin from zope.location.interfaces import LocationError request = FauxRequest() ob = object() traverser = skin(ob, request) self.assertRaises(LocationError, traverser.traverse, 'bar', ())
def test(self): from zope.traversing.namespace import skin request = FauxRequest() ob = object() ob2 = skin(ob, request).traverse('foo', ()) self.assertEqual(ob, ob2) self.assertTrue(IFoo.providedBy(request)) self.assertEqual(request.shifted, 1)