##// END OF EJS Templates
hgweb: return meaningful HTTP status codes instead of nonsense
hgweb: return meaningful HTTP status codes instead of nonsense

File last commit:

r5561:22713dce default
r5561:22713dce default
Show More
test-hgweb
31 lines | 1011 B | text/plain | TextLexer
Brendan Cully
hgweb: simple tests
r3942 #!/bin/sh
hg init test
cd test
mkdir da
echo foo > da/foo
echo foo > foo
hg ci -Ambase -d '0 0'
Bryan O'Sullivan
Allow tests to run in parallel.
r5384 hg serve -p $HGPORT -d --pid-file=hg.pid
Bryan O'Sullivan
hgweb: return meaningful HTTP status codes instead of nonsense
r5561 cat hg.pid >> $DAEMON_PIDS
Brendan Cully
hgweb: simple tests
r3942 echo % manifest
Bryan O'Sullivan
Allow tests to run in parallel.
r5384 ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/?style=raw')
("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/da?style=raw')
Bryan O'Sullivan
hgweb: return meaningful HTTP status codes instead of nonsense
r5561
echo % plain file
"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/foo?style=raw'
echo % should give a 404 - static file that does not exist
"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/static/bogus'
echo % should give a 404 - bad revision
"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/spam/foo?style=raw'
echo % should give a 400 - bad command
"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/foo?cmd=spam&style=raw'
echo % should give a 404 - file does not exist
"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/bork?style=raw'
echo % static file
"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/static/style-gitweb.css'