Add test for generate-secrets
This commit is contained in:
parent
edfa762a39
commit
dd30b5e329
1 changed files with 16 additions and 0 deletions
|
@ -4,10 +4,12 @@
|
|||
:cljs [cljs.test :refer-macros [deftest is are testing run-tests]])
|
||||
[clojure.spec.test.alpha :as st]
|
||||
[dda.c4k-common.common-test :as ct]
|
||||
[dda.c4k-common.base64 :as b64]
|
||||
[dda.c4k-gitea.gitea :as cut]))
|
||||
|
||||
(st/instrument `cut/generate-appini-env)
|
||||
(st/instrument `cut/generate-ingress)
|
||||
(st/instrument `cut/generate-secrets)
|
||||
|
||||
(deftest should-generate-appini-env
|
||||
(is (= {:GITEA__database__USER-c1 nil,
|
||||
|
@ -28,3 +30,17 @@
|
|||
(is (= {:name-c2 "prod", :name-c1 "staging"}
|
||||
(ct/map-diff (cut/generate-certificate {})
|
||||
(cut/generate-certificate {:issuer "prod"})))))
|
||||
|
||||
(deftest should-generate-secret
|
||||
(is (= {:GITEA__mailer__USER-c1 "",
|
||||
:GITEA__mailer__USER-c2 (b64/encode "mailuser"),
|
||||
:GITEA__mailer__PASSWD-c1 "",
|
||||
:GITEA__mailer__PASSWD-c2 (b64/encode "mailpw")}
|
||||
(ct/map-diff (cut/generate-secrets {:postgres-db-user ""
|
||||
:postgres-db-password ""
|
||||
:maileruser ""
|
||||
:mailerpw ""})
|
||||
(cut/generate-secrets {:postgres-db-user ""
|
||||
:postgres-db-password ""
|
||||
:maileruser "mailuser"
|
||||
:mailerpw "mailpw"})))))
|
Loading…
Reference in a new issue