Mercurial > hg-stable
diff tests/test-hgweb @ 5561:22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Wed, 28 Nov 2007 08:38:42 -0800 |
parents | e3a0c092b4e2 |
children | b4af2dd9868a |
line wrap: on
line diff
--- a/tests/test-hgweb Wed Nov 28 08:38:06 2007 -0800 +++ b/tests/test-hgweb Wed Nov 28 08:38:42 2007 -0800 @@ -7,7 +7,25 @@ echo foo > foo hg ci -Ambase -d '0 0' hg serve -p $HGPORT -d --pid-file=hg.pid +cat hg.pid >> $DAEMON_PIDS echo % manifest ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/?style=raw') ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/da?style=raw') -kill `cat hg.pid` + +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'