MCPcopy
hub / github.com/Pylons/pyramid / __init__

Method __init__

src/pyramid/testing.py:145–168  ·  view source on GitHub ↗

The resource's ``__name__`` attribute will be set to the value of the ``__name__`` argument, and the resource's ``__parent__`` attribute will be set to the value of the ``__parent__`` argument. If ``__provides__`` is specified, it should be an interface object or tup

(
        self, __name__=None, __parent__=None, __provides__=None, **kw
    )

Source from the content-addressed store, hash-verified

143 """A dummy :app:`Pyramid` :term:`resource` object."""
144
145 def __init__(
146 self, __name__=None, __parent__=None, __provides__=None, **kw
147 ):
148 """The resource's ``__name__`` attribute will be set to the
149 value of the ``__name__`` argument, and the resource's
150 ``__parent__`` attribute will be set to the value of the
151 ``__parent__`` argument. If ``__provides__`` is specified, it
152 should be an interface object or tuple of interface objects
153 that will be attached to the resulting resource via
154 :func:`zope.interface.alsoProvides`. Any extra keywords passed
155 in the ``kw`` argument will be set as direct attributes of
156 the resource object.
157
158 .. note:: For backwards compatibility purposes, this class can also
159 be imported as :class:`pyramid.testing.DummyModel`.
160
161 """
162 self.__name__ = __name__
163 self.__parent__ = __parent__
164 if __provides__ is not None:
165 alsoProvides(self, __provides__)
166 self.kw = kw
167 self.__dict__.update(**kw)
168 self.subs = {}
169
170 def __setitem__(self, name, val):
171 """When the ``__setitem__`` method is called, the object

Callers

nothing calls this directly

Calls 1

updateMethod · 0.80

Tested by

no test coverage detected