changeset 29:d8b73d9b679d

separate testing fileapp to its own doctest file
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 05 Mar 2012 13:27:06 -0800
parents 4509330ef8ad
children 52103702a732
files tests/test_directory_server.txt tests/test_fileapp.txt
diffstat 2 files changed, 24 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test_directory_server.txt	Mon Mar 05 13:24:10 2012 -0800
+++ b/tests/test_directory_server.txt	Mon Mar 05 13:27:06 2012 -0800
@@ -1,5 +1,5 @@
-Test FileServer
-===============
+Test Directory Server
+=====================
 
 The obligatory imports::
 
@@ -8,19 +8,6 @@
     >>> import urlparse
     >>> from paste.fixture import TestApp
 
-Make a single file server::
-
-    >>> filename = os.path.join(here, 'example', 'helloworld.txt')
-    >>> os.path.exists(filename)
-    True
-    >>> app = fileserver.FileApp(filename)
-    >>> testapp = TestApp(app)
-    >>> response = testapp.get('/')
-    >>> response.status
-    200
-    >>> response.body == file(filename).read()
-    True
-
 Make a directory server::
 
     >>> directory = os.path.join(here, 'example')
@@ -42,6 +29,7 @@
     >>> response = testapp.get('/helloworld.txt')
     >>> response.status
     200
+    >>> filename = os.path.join(here, 'example', 'helloworld.txt')
     >>> response.body == file(filename).read()
     True
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test_fileapp.txt	Mon Mar 05 13:27:06 2012 -0800
@@ -0,0 +1,21 @@
+Test FileApp
+============
+
+The obligatory imports::
+
+    >>> import fileserver
+    >>> import os
+    >>> from paste.fixture import TestApp
+
+Make a single file server::
+
+    >>> filename = os.path.join(here, 'example', 'helloworld.txt')
+    >>> os.path.exists(filename)
+    True
+    >>> app = fileserver.FileApp(filename)
+    >>> testapp = TestApp(app)
+    >>> response = testapp.get('/')
+    >>> response.status
+    200
+    >>> response.body == file(filename).read()
+    True