comparison tests/doctest.txt @ 14:c8520774ddc9

add a test for reading subdirectory files
author Jeff Hammel <jhammel@mozilla.com>
date Wed, 29 Feb 2012 15:45:27 -0800
parents 8127dde8da22
children 21673816cfde
comparison
equal deleted inserted replaced
13:e3993fa05b89 14:c8520774ddc9
63 >>> response = testapp.get('/foo/') 63 >>> response = testapp.get('/foo/')
64 >>> response.status 64 >>> response.status
65 200 65 200
66 >>> 'bar.txt' in response.body 66 >>> 'bar.txt' in response.body
67 True 67 True
68 >>> response = testapp.get('/foo/bar.txt')
69 >>> response.status
70 200
71 >>> filename = os.path.join(here, 'example', 'foo', 'bar.txt')
72 >>> response.body == file(filename).read()
73 True
68 74
69 Ensure you can't get to non-allowed resources:: 75 Ensure you can't get to non-allowed resources::
70 76
71 >>> response = testapp.get('/../exampleBADBADBAD') 77 >>> response = testapp.get('/../exampleBADBADBAD')
78 >>> response.status # Not Found: we do not want to give away these resources
79 404