2021-02-26 13:29:01 +00:00
|
|
|
(ns dda.k8s-mastodon-bot.yaml-test
|
2021-02-19 17:41:51 +00:00
|
|
|
(:require
|
|
|
|
[clojure.test :refer [deftest is testing are]]
|
|
|
|
[dda.k8s-mastodon-bot.yaml :as cut]))
|
|
|
|
|
2021-02-23 08:15:05 +00:00
|
|
|
(deftest should-parse-yaml-string
|
|
|
|
(is (= {:hallo "welt"}
|
2021-02-19 17:41:51 +00:00
|
|
|
(cut/from-string "hallo: welt"))))
|
2021-02-23 08:15:05 +00:00
|
|
|
|
|
|
|
(deftest should-generate-yaml-string
|
|
|
|
(is (= "hallo: welt
|
|
|
|
"
|
|
|
|
(cut/to-string {:hallo "welt"}))))
|
2021-02-26 13:29:01 +00:00
|
|
|
|
|
|
|
(deftest should-convert-config-yml-to-map
|
|
|
|
(is (= {:apiVersion "v1", :kind "ConfigMap"
|
|
|
|
:metadata {:name "mastodon-bot",
|
|
|
|
:labels {:app.kubernetes.io/name "k8s-mastodon-bot"}},
|
|
|
|
:data {:config.edn "some-config-value\n",
|
|
|
|
:credentials.edn "some-credentials-value\n"}}
|
2021-02-26 13:44:02 +00:00
|
|
|
(cut/from-string (cut/load-resource "config.yaml")))))
|