From 1159f9ec182496ddc5324f23fb1d5eae73fe63e3 Mon Sep 17 00:00:00 2001 From: hut Date: Sun, 13 Dec 2009 19:42:51 +0100 Subject: updated / added tests --- test/__init__.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'test/__init__.py') 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() -- cgit 1.4.1-2-gfad0