# HG changeset patch # User Jeff Hammel # Date 1330983615 28800 # Node ID 52103702a7321bc702f1d04853dfe5680ec713ac # Parent d8b73d9b679db2054c9c22797033c4a720060735 figured out the magical code for doctest.ELLIPSIS diff -r d8b73d9b679d -r 52103702a732 tests/test_fileapp.txt --- a/tests/test_fileapp.txt Mon Mar 05 13:27:06 2012 -0800 +++ b/tests/test_fileapp.txt Mon Mar 05 13:40:15 2012 -0800 @@ -6,6 +6,7 @@ >>> import fileserver >>> import os >>> from paste.fixture import TestApp + >>> from webob import Request Make a single file server:: @@ -19,3 +20,21 @@ 200 >>> response.body == file(filename).read() True + +With conditional_response on, and with last_modified and etag set, we +can do conditional requests:: + + >>> content_length = os.path.getsize(filename) + >>> content_length # don't ask me why the 'L' + 6L + >>> req = Request.blank('/') + >>> res = req.get_response(app) + >>> print res # doctest:+ELLIPSIS + 200 OK + Content-Type: text/plain; charset=UTF-8 + Content-Length: 6 + Last-Modified: ... GMT + ETag: ...-... + + hello +