traversal
*********

The TraverseWithGet class makes it easy to implement IPublishTraverse
just by defining a get() method like the one seen in Python's dict
class. In fact, a dict will work fine.

    >>> from lazr.restful.example.base.traversal import TraverseWithGet
    >>> obj1, obj2 = object(), object()
    >>> context = {"name1":obj1, "name2":obj2}
    >>> request = object()
    >>> container = TraverseWithGet(context, request)

Traversal is handled with the context's get() method.

    >>> value = container.publishTraverse(request, "name1")
    >>> value == obj1
    True

If the object cannot be found, publishTraverse raises a NotFound
error.

    >>> container.publishTraverse(request, "nosuchname")
    Traceback (most recent call last):
    ...
    NotFound: ... name: 'nosuchname'
