test "post with image" passed
This commit is contained in:
parent
1ebb0e71f5
commit
48d0c22b5a
2 changed files with 30 additions and 2 deletions
|
@ -144,7 +144,7 @@
|
||||||
(.on "response"
|
(.on "response"
|
||||||
(fn [image-stream]
|
(fn [image-stream]
|
||||||
(post-image mastodon-config image-stream status-text
|
(post-image mastodon-config image-stream status-text
|
||||||
#(post-status-with-images status-text urls (conj ids %) callback)))))
|
#(post-status-with-images mastodon-config status-text urls (conj ids %) callback)))))
|
||||||
(post-status mastodon-config status-text (not-empty ids) callback))))
|
(post-status mastodon-config status-text (not-empty ids) callback))))
|
||||||
|
|
||||||
(defn-spec get-mastodon-timeline any?
|
(defn-spec get-mastodon-timeline any?
|
||||||
|
@ -161,7 +161,7 @@
|
||||||
[mastodon-config mastodon-config?
|
[mastodon-config mastodon-config?
|
||||||
last-post-time any?
|
last-post-time any?
|
||||||
items any?]
|
items any?]
|
||||||
(doseq [{:mastodon-bot.mastodon-api/keys [text media-links]}
|
(doseq [{:keys [text media-links]}
|
||||||
(->> items
|
(->> items
|
||||||
(remove #((blocked-content? mastodon-config (:text %))))
|
(remove #((blocked-content? mastodon-config (:text %))))
|
||||||
(filter #(> (:created-at %) last-post-time)))]
|
(filter #(> (:created-at %) last-post-time)))]
|
||||||
|
|
28
src/test/mastodon_bot/mytest.cljs
Normal file
28
src/test/mastodon_bot/mytest.cljs
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
(ns mastodon-bot.mytest
|
||||||
|
(:require
|
||||||
|
[mastodon-bot.infra :as infra]
|
||||||
|
[clojure.pprint :refer [pprint]]
|
||||||
|
[mastodon-bot.mastodon-api :as masto]))
|
||||||
|
|
||||||
|
(defn myconfig []
|
||||||
|
(:mastodon-config (infra/load-config)))
|
||||||
|
|
||||||
|
(defn test-timeline []
|
||||||
|
(masto/get-mastodon-timeline
|
||||||
|
(myconfig)
|
||||||
|
pprint))
|
||||||
|
|
||||||
|
(defn test-status []
|
||||||
|
(masto/post-status
|
||||||
|
(myconfig)
|
||||||
|
"test"
|
||||||
|
nil
|
||||||
|
pprint))
|
||||||
|
|
||||||
|
(defn test-status-image []
|
||||||
|
(masto/post-status-with-images
|
||||||
|
(myconfig)
|
||||||
|
"test2"
|
||||||
|
["https://pbs.twimg.com/media/ER3qX2RW4AEhQfW.jpg"]
|
||||||
|
[]
|
||||||
|
pprint))
|
Reference in a new issue