diff options
| author | eltrac <hi@eltr.ac> | 2026-09-23 15:11:03 +0800 |
|---|---|---|
| committer | Eltrac <hi@eltr.ac> | 2026-09-24 05:51:07 +0200 |
| commit | 64a59447a9bcb9956eef6afef1d9d748a51156c5 (patch) | |
| tree | 091b8db25e4a1cc9c2aaaea365d18e5eddc03a92 /src | |
| parent | 5fa1f0cb40153410964c2431c3e1bd16ce309b0e (diff) | |
test: improve test coverage #28
- remove reducer spec warninns, test spec before compiling instead.
- cover more forms of webhook.clj, webhook_presets.clj,
microformats/reducer.clj, microformats/searcher.clj, http/downloader.clj
- remove unused code from config.clj
- format all tests
Diffstat (limited to 'src')
| -rw-r--r-- | src/weepinbell/config.clj | 5 | ||||
| -rw-r--r-- | src/weepinbell/microformats/reducer.clj | 12 |
2 files changed, 4 insertions, 13 deletions
diff --git a/src/weepinbell/config.clj b/src/weepinbell/config.clj index d784e2c..0fb47a8 100644 --- a/src/weepinbell/config.clj +++ b/src/weepinbell/config.clj @@ -12,8 +12,3 @@ (-> external-file slurp edn/read-string))] (merge default-config external-config))) -(def config (delay (load-config))) - -(defn get-config [key & keys] - (get-in @config (cons key keys))) - diff --git a/src/weepinbell/microformats/reducer.clj b/src/weepinbell/microformats/reducer.clj index 0407b74..552b0d1 100644 --- a/src/weepinbell/microformats/reducer.clj +++ b/src/weepinbell/microformats/reducer.clj @@ -1,8 +1,7 @@ (ns weepinbell.microformats.reducer
(:require [weepinbell.microformats.searcher :refer [use-items find-h-card find-h-entry
search-photo use-prop]]
- [clojure.spec.alpha :as s]
- [taoensso.timbre :as timbre]))
+ [clojure.spec.alpha :as s]))
(s/def ::author
(s/keys :req-un [::name]
@@ -24,14 +23,11 @@ author (or (->> entry (use-prop :author))
card)
photo (or (search-photo author)
- (search-photo card))
- data {:author {:name (use-prop :name author)
+ (search-photo card))]
+ {:author {:name (use-prop :name author)
:url (use-prop :url author)
:photo photo}
:type (find-type entry)
:published (use-prop :published entry)
- :content (use-prop :content entry)}]
- (when (not (s/valid? ::reduced-microformats data))
- (timbre/warn "Microformats weren't properly reduced: " mf))
- data))
+ :content (use-prop :content entry)}))
|
