changeset 484:38d18a21fea9

added simple test for status code of the whole wiki
author sheep@ghostwheel
date Mon, 06 Oct 2008 10:24:53 +0200
parents d795c8679f4d
children 36c185629dd3
files dandelion/config.py dandelion/wiki.py
diffstat 2 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/dandelion/config.py	Mon Oct 06 09:59:56 2008 +0200
+++ b/dandelion/config.py	Mon Oct 06 10:24:53 2008 +0200
@@ -11,15 +11,15 @@
 
             data_dir: the path to a directory containing the "config" file
         """
-        self.data_dir = data_dir
+        self.data_dir = data_dir or "data"
         self.filename = os.path.join(data_dir, "config")
         self.parser = ConfigParser.SafeConfigParser()
         self.defaults = {
-            ("setup", "data_dir"): data_dir,
+            ("setup", "data_dir"): self.data_dir,
             ("setup", "port"): "8080",
             ("setup", "interface"): "",
             ("setup", "base_url"): "",
-            ("wiki", "data_dir"): data_dir,
+            ("wiki", "data_dir"): self.data_dir,
             ("wiki", "changes_page"): u"RecentChanges",
             ("wiki", "start_page"): u"FrontPage",
             ("wiki", "create_type"): "text/plain",
--- a/dandelion/wiki.py	Mon Oct 06 09:59:56 2008 +0200
+++ b/dandelion/wiki.py	Mon Oct 06 10:24:53 2008 +0200
@@ -26,6 +26,10 @@
         by the plugins.
         
         Also contains some common utility functions.
+
+        >>> from werkzeug import Client, BaseResponse
+        >>> Client(Wiki(None).application, BaseResponse).get('/').status_code in (200, 404)
+        True
     """
     def __init__(self, cfg=None):
         if cfg is None: