comparison tests/test_fileapp.txt @ 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
children 52103702a732
comparison
equal deleted inserted replaced
28:4509330ef8ad 29:d8b73d9b679d
1 Test FileApp
2 ============
3
4 The obligatory imports::
5
6 >>> import fileserver
7 >>> import os
8 >>> from paste.fixture import TestApp
9
10 Make a single file server::
11
12 >>> filename = os.path.join(here, 'example', 'helloworld.txt')
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