]> arthur.barton.de Git - bup.git/blobdiff - t/test-web.sh
midx-cmd: accommodate python 3
[bup.git] / t / test-web.sh
index 842b6e9cc900aee6b00be6ada5e55f9fb84d06f1..1e10adaa7d394055c3705cd0d1bedb417638683a 100755 (executable)
@@ -36,27 +36,33 @@ if test -z "$(type -p curl)"; then
 fi
     
 WVPASS bup-python -c "import socket as s; s.socket(s.AF_UNIX).bind('socket')"
-curl --unix-socket ./socket http://localhost/foo
+curl -s --unix-socket ./socket http://localhost/foo
 if test $? -ne 7; then
     WVSTART 'curl does not appear to support --unix-socket; skipping test'
     run_test=''
 fi
-    
+
+if ! bup-python -c 'import tornado' 2> /dev/null; then
+    WVSTART 'unable to import tornado; skipping test'
+    run_test=''
+fi
+
 if test -n "$run_test"; then
     WVSTART 'web'
     WVPASS bup init
     WVPASS mkdir src
-    WVPASS echo excitement > src/data
+    WVPASS echo '¡excitement!' > src/data
     WVPASS bup index src
-    WVPASS bup save -n src --strip src
+    WVPASS bup save -n '¡excitement!' --strip src
 
     "$TOP/bup" web unix://socket &
     web_pid=$!
     wait-for-server-start
 
-    WVPASS curl --unix-socket ./socket http://localhost/src/latest/data > result
+    WVPASS curl --unix-socket ./socket \
+           'http://localhost/%C2%A1excitement%21/latest/data' > result
 
-    WVPASSEQ excitement "$(cat result)"
+    WVPASSEQ '¡excitement!' "$(cat result)"
     WVPASS kill -s TERM "$web_pid"
     WVPASS wait "$web_pid"
 fi