tests/test-hgweb-no-path-info.t
changeset 28861 86db5cb55d46
parent 28857 9f67cf7cc28e
child 29439 c42a3fd5c1fc
equal deleted inserted replaced
28860:50d11dd8ac02 28861:86db5cb55d46
    16   
    16   
    17   $ cat > request.py <<EOF
    17   $ cat > request.py <<EOF
    18   > from __future__ import absolute_import
    18   > from __future__ import absolute_import
    19   > import os
    19   > import os
    20   > import sys
    20   > import sys
    21   > from StringIO import StringIO
       
    22   > from mercurial.hgweb import (
    21   > from mercurial.hgweb import (
    23   >     hgweb,
    22   >     hgweb,
    24   >     hgwebdir,
    23   >     hgwebdir,
    25   > )
    24   > )
       
    25   > from mercurial import (
       
    26   >     util,
       
    27   > )
       
    28   > stringio = util.stringio
    26   > 
    29   > 
    27   > errors = StringIO()
    30   > errors = stringio()
    28   > input = StringIO()
    31   > input = stringio()
    29   > 
    32   > 
    30   > def startrsp(status, headers):
    33   > def startrsp(status, headers):
    31   >     print '---- STATUS'
    34   >     print '---- STATUS'
    32   >     print status
    35   >     print status
    33   >     print '---- HEADERS'
    36   >     print '---- HEADERS'
    57   >     sys.stdout.write(''.join(content))
    60   >     sys.stdout.write(''.join(content))
    58   >     getattr(content, 'close', lambda : None)()
    61   >     getattr(content, 'close', lambda : None)()
    59   >     print '---- ERRORS'
    62   >     print '---- ERRORS'
    60   >     print errors.getvalue()
    63   >     print errors.getvalue()
    61   > 
    64   > 
    62   > output = StringIO()
    65   > output = stringio()
    63   > env['QUERY_STRING'] = 'style=atom'
    66   > env['QUERY_STRING'] = 'style=atom'
    64   > process(hgweb('.', name='repo'))
    67   > process(hgweb('.', name='repo'))
    65   > 
    68   > 
    66   > output = StringIO()
    69   > output = stringio()
    67   > env['QUERY_STRING'] = 'style=raw'
    70   > env['QUERY_STRING'] = 'style=raw'
    68   > process(hgwebdir({'repo': '.'}))
    71   > process(hgwebdir({'repo': '.'}))
    69   > EOF
    72   > EOF
    70   $ python request.py
    73   $ python request.py
    71   ---- STATUS
    74   ---- STATUS