aboutsummaryrefslogtreecommitdiff
path: root/test/mastodon-http-tests.el
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-04-30 12:18:03 +0200
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-04-30 12:18:03 +0200
commita44f2363f6c74a91844b43a57e434646adc059c4 (patch)
tree183cb309546869414b582fd7a25f9b93f578350f /test/mastodon-http-tests.el
parent780dead06547b15d28cf073e787ae67d6a752c26 (diff)
parent9613f51d57e5235de99b3e3a7ec6cb24cffdf70e (diff)
Merge branch 'develop'
Diffstat (limited to 'test/mastodon-http-tests.el')
-rw-r--r--test/mastodon-http-tests.el17
1 files changed, 16 insertions, 1 deletions
diff --git a/test/mastodon-http-tests.el b/test/mastodon-http-tests.el
index 57b52a4..b3a02bc 100644
--- a/test/mastodon-http-tests.el
+++ b/test/mastodon-http-tests.el
@@ -76,10 +76,25 @@ Strict-Transport-Security: max-age=31536000
(let ((response-buffer
(get-buffer-create "mastodon-http--triage-buffer")))
(with-current-buffer response-buffer
- (erase-buffer)
+ (erase-buffer)
(insert mastodon-http--example-400))
(should (equal (mastodon-http--triage
response-buffer
(lambda ()
(message "success call")))
"Error 444: some unhappy complaint"))))
+
+(ert-deftest mastodon-http-params-build ()
+ "Should correctly format parameters from an alist."
+ (let ((params '(("q" . "test")
+ ("foo" . "bar"))))
+ (should (string= (mastodon-http--build-params-string params)
+ "q=test&foo=bar"))))
+
+(ert-deftest mastodon-http-params-array-build ()
+ "Should correctly format parameters from an alist."
+ (let ((array '("option" "option2"))
+ (param-str "poll[x][]"))
+ (should (equal (mastodon-http--build-array-params-alist param-str array)
+ '(("poll[x][]" . "option")
+ ("poll[x][]" . "option2"))))))