From fde65270afb3855057a86b40c5996c86f58fe97b Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Mon, 30 Jul 2012 20:58:59 +1200 Subject: Testing examples and docs. --- libpathod/test.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libpathod/test.py') diff --git a/libpathod/test.py b/libpathod/test.py index 53daa5bf..e431be18 100644 --- a/libpathod/test.py +++ b/libpathod/test.py @@ -12,6 +12,13 @@ class Daemon: self.port = self.q.get(True, 5) self.urlbase = "%s://%s:%s"%("https" if ssl else "http", self.IFACE, self.port) + def __enter__(self): + return self + + def __exit__(self, type, value, traceback): + self.shutdown() + return False + def p(self, spec): """ Return a URL that will render the response in spec. -- cgit v1.2.3