c4k-mastodon-bot/src/test/cljc/dda/k8s_mastodon_bot/yaml_test.cljc

22 lines
743 B
Text
Raw Normal View History

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"}}
(cut/from-string (cut/load-resource "config.yml")))))