comparison tests/doctest.txt @ 8:782e15b86b86

serve file contents
author Jeff Hammel <jhammel@mozilla.com>
date Wed, 29 Feb 2012 14:51:00 -0800
parents 4d1852cfc077
children 68db1111f23a
comparison
equal deleted inserted replaced
7:4d1852cfc077 8:782e15b86b86
25 >>> directory = os.path.join(here, 'example') 25 >>> directory = os.path.join(here, 'example')
26 >>> os.path.exists(directory) and os.path.isdir(directory) 26 >>> os.path.exists(directory) and os.path.isdir(directory)
27 True 27 True
28 >>> app = fileserver.DirectoryServer(directory) 28 >>> app = fileserver.DirectoryServer(directory)
29 >>> testapp = TestApp(app) 29 >>> testapp = TestApp(app)
30
31 Ensure you can serve directory listings::
32
30 >>> response = testapp.get('/') 33 >>> response = testapp.get('/')
31 >>> response.status 34 >>> response.status
32 200 35 200
33 >>> 'helloworld.txt' in response.body 36 >>> 'helloworld.txt' in response.body
34 True 37 True
35 38
39 Ensure you can serve file contents::
40
41 >>> response = testapp.get('/helloworld.txt')
42 >>> response.status
43 200