From c4c1575a20fffd9cd9b76e369d3bda7f88545e41 Mon Sep 17 00:00:00 2001 From: eltrac Date: Fri, 30 Oct 2026 14:58:17 +0800 Subject: test: create dummy file before delete, to avoid test failure --- test/weepinbell/downloader_test.clj | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/weepinbell/downloader_test.clj b/test/weepinbell/downloader_test.clj index 469c9ba..0d92f11 100644 --- a/test/weepinbell/downloader_test.clj +++ b/test/weepinbell/downloader_test.clj @@ -34,11 +34,15 @@ (testing "Exception/Error thrown while downloading" (with-redefs [weepinbell.http.client/get! (fn [& _] (throw (.Error "Test error")))] - (is (false? (download-file "" ""))))) + (let [dest "tmp/error-thrown-while-downloading"] + (io/make-parents dest) + (spit "tmp/test" dest) + (is (false? (download-file "" "tmp/test")))))) (testing "Deletes possibly corrupted file when failure is caught" (with-redefs [weepinbell.http.client/get! (fn [& _] (throw (.Error "Test error")))] (let [dest "dest"] + (io/make-parents dest) (spit dest "CORRUPTED") (is (false? (download-file "" dest))) (is (not (.exists (io/file dest)))))))) -- cgit v1.2.3