From 0349692db000663308bcc8c3643baf79fcb1363c Mon Sep 17 00:00:00 2001 From: etahto Date: Wed, 18 Dec 2024 14:19:52 +0200 Subject: [PATCH] Add tests --- .../clj/solita/etp/service/csv_to_s3_test.clj | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 etp-core/etp-backend/src/test/clj/solita/etp/service/csv_to_s3_test.clj diff --git a/etp-core/etp-backend/src/test/clj/solita/etp/service/csv_to_s3_test.clj b/etp-core/etp-backend/src/test/clj/solita/etp/service/csv_to_s3_test.clj new file mode 100644 index 000000000..94e4cd03f --- /dev/null +++ b/etp-core/etp-backend/src/test/clj/solita/etp/service/csv_to_s3_test.clj @@ -0,0 +1,15 @@ +(ns solita.etp.service.csv-to-s3-test + (:require [solita.etp.service.csv-to-s3 :as csv-to-s3] + [solita.etp.service.file :as file] + [clojure.test :as t] + [solita.etp.test-system :as ts])) + +(t/use-fixtures :each ts/fixture) + +(t/deftest test-public-csv-to-s3 + (t/testing "Public csv doesn't exist before generating" + (t/is (false? (file/file-exists? ts/*aws-s3-client* "/api/csv/public/energiatodistukset.csv")))) + + (t/testing "Public csv exists after generating" + (csv-to-s3/update-public-csv-in-s3! ts/*db* {:id -5 :rooli 2} ts/*aws-s3-client* {:where nil}) + (t/is (true? (file/file-exists? ts/*aws-s3-client* "/api/csv/public/energiatodistukset.csv")))))