Exemplo n.º 1
0

class FakeModule:
    def __init__(self, dict):
        self.__dict = dict

    def __getattr__(self, name):
        try:
            return self.__dict[name]
        except KeyError:
            raise AttributeError(name)


name = 'zope.app.locking.README'

ps = PlacelessSetup()


class FakeKeyReference(object):
    """Fake keyref for testing"""
    def __init__(self, object):
        self.object = object

    def __call__(self):
        return self.object

    def __hash__(self):
        return id(self.object)

    def __eq__(self, other):
        return id(self.object) == id(other.object)