tests/test-hgweb-empty.t
changeset 51834 3b8d92f71d92
parent 38482 5faaa31a6082
--- a/tests/test-hgweb-empty.t	Thu Sep 05 13:37:24 2024 +0200
+++ b/tests/test-hgweb-empty.t	Wed Nov 15 22:11:34 2023 +0100
@@ -1,9 +1,15 @@
 #require serve
 
-Some tests for hgweb in an empty repository
+Some tests for hgweb in an empty repository and empty archive
 
   $ hg init test
   $ cd test
+  $ cat << EOF >> .hg/hgrc
+  > [web]
+  > allow-archive = zip
+  > [ui]
+  > archivemeta = False
+  > EOF
   $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
   $ cat hg.pid >> $DAEMON_PIDS
   $ (get-with-headers.py localhost:$HGPORT 'shortlog')
@@ -44,6 +50,9 @@
   </ul>
   <ul>
   
+  <li>
+  <a href="/archive/tip.zip">zip</a>
+  </li>
   </ul>
   <ul>
    <li><a href="/help">help</a></li>
@@ -155,6 +164,9 @@
   </ul>
   <ul>
   
+  <li>
+  <a href="/archive/tip.zip">zip</a>
+  </li>
   </ul>
   <ul>
    <li><a href="/help">help</a></li>
@@ -264,6 +276,9 @@
   </ul>
   <ul>
   
+  <li>
+  <a href="/archive/tip.zip">zip</a>
+  </li>
   </ul>
   <ul>
    <li><a href="/help">help</a></li>
@@ -369,6 +384,9 @@
   </ul>
   <ul>
   
+  <li>
+  <a href="/archive/tip.zip">zip</a>
+  </li>
   </ul>
   <ul>
    <li><a href="/help">help</a></li>
@@ -428,4 +446,14 @@
   
   </feed>
 
+Fetching an empty archive
+-------------------------
+
+Test that archiving without matching files is rejected as error,
+not as Internal Server Error.
+
+  $ get-with-headers.py --headeronly localhost:$HGPORT archive/null.zip
+  403 Forbidden
+  [1]
+
   $ cd ..