diff options
Diffstat (limited to 'test/__init__.py')
-rw-r--r-- | test/__init__.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/__init__.py b/test/__init__.py index 500d3383..3043ba18 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -6,3 +6,24 @@ __all__ = [ x[0:x.index('.')] \ def init(): sys.path.append(os.path.abspath(os.path.join(sys.path[0], '..'))) + +class Fake(object): + def __getattr__(self, attrname): + if not hasattr(self, attrname): + setattr(self, attrname, Fake()) + return self.__dict__[attrname] + + def __call__(self, *_): + return Fake() + + def __clear__(self): + self.__dict__.clear() + + def __iter__(self): + return iter(()) + +class OK(Exception): + pass + +def raise_ok(*_, **__): + raise OK() |