comparison tests/doctest.txt @ 7:4d1852cfc077

rudimentary test for directory server
author Jeff Hammel <jhammel@mozilla.com>
date Wed, 29 Feb 2012 14:48:53 -0800
parents 623358c3ebde
children 782e15b86b86
comparison
equal deleted inserted replaced
6:623358c3ebde 7:4d1852cfc077
17 >>> response = testapp.get('/') 17 >>> response = testapp.get('/')
18 >>> response.status 18 >>> response.status
19 200 19 200
20 >>> response.body == file(filename).read() 20 >>> response.body == file(filename).read()
21 True 21 True
22
23 Make a directory server::
24
25 >>> directory = os.path.join(here, 'example')
26 >>> os.path.exists(directory) and os.path.isdir(directory)
27 True
28 >>> app = fileserver.DirectoryServer(directory)
29 >>> testapp = TestApp(app)
30 >>> response = testapp.get('/')
31 >>> response.status
32 200
33 >>> 'helloworld.txt' in response.body
34 True
35