# HG changeset patch # User Jeff Hammel # Date 1330982826 28800 # Node ID d8b73d9b679db2054c9c22797033c4a720060735 # Parent 4509330ef8ade40b307121b8940f16df6a5e3eed separate testing fileapp to its own doctest file diff -r 4509330ef8ad -r d8b73d9b679d tests/test_directory_server.txt --- 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 diff -r 4509330ef8ad -r d8b73d9b679d tests/test_fileapp.txt --- /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