3 test_description
='test downloading a file by URL'
5 TEST_PASSES_SANITIZE_LEAK
=true
9 .
"$TEST_DIRECTORY"/lib-httpd.sh
12 test_expect_success
'get by URL: 404' '
13 test_when_finished "rm -f file.temp" &&
14 url="$HTTPD_URL/none.txt" &&
20 test_must_fail git remote-http $url <input 2>err &&
21 test_path_is_missing file1 &&
22 grep "failed to download file at URL" err
25 test_expect_success
'get by URL: 200' '
26 echo data >"$HTTPD_DOCUMENT_ROOT_PATH/exists.txt" &&
28 url="$HTTPD_URL/exists.txt" &&
35 git remote-http $url <input &&
36 test_cmp "$HTTPD_DOCUMENT_ROOT_PATH/exists.txt" file2