Mercurial > hg > FileServer
diff tests/doctest.txt @ 6:623358c3ebde
we has a passing test!
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Wed, 29 Feb 2012 14:44:04 -0800 |
parents | 8d31e36f084e |
children | 4d1852cfc077 |
line wrap: on
line diff
--- a/tests/doctest.txt Wed Feb 29 14:17:34 2012 -0800 +++ b/tests/doctest.txt Wed Feb 29 14:44:04 2012 -0800 @@ -1,11 +1,21 @@ Test FileServer ================ -The obligatory imports: +The obligatory imports:: >>> import fileserver + >>> import os + >>> from paste.fixture import TestApp -Run some tests. This test will fail, please fix it: +Make a single file server:: - >>> assert True == False - + >>> 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