Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
etahto committed Dec 18, 2024
1 parent d92a8fd commit 0349692
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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")))))

0 comments on commit 0349692

Please sign in to comment.