Mercurial > hg > FileServer
comparison 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 |
comparison
equal
deleted
inserted
replaced
5:78f1ffd064ea | 6:623358c3ebde |
---|---|
1 Test FileServer | 1 Test FileServer |
2 ================ | 2 ================ |
3 | 3 |
4 The obligatory imports: | 4 The obligatory imports:: |
5 | 5 |
6 >>> import fileserver | 6 >>> import fileserver |
7 >>> import os | |
8 >>> from paste.fixture import TestApp | |
7 | 9 |
8 Run some tests. This test will fail, please fix it: | 10 Make a single file server:: |
9 | 11 |
10 >>> assert True == False | 12 >>> filename = os.path.join(here, 'example', 'helloworld.txt') |
11 | 13 >>> os.path.exists(filename) |
14 True | |
15 >>> app = fileserver.FileApp(filename) | |
16 >>> testapp = TestApp(app) | |
17 >>> response = testapp.get('/') | |
18 >>> response.status | |
19 200 | |
20 >>> response.body == file(filename).read() | |
21 True |