[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/plz 220f882ee4 53/81: Tests: (plz-post-jpeg-string) Add
From: |
ELPA Syncer |
Subject: |
[elpa] externals/plz 220f882ee4 53/81: Tests: (plz-post-jpeg-string) Add |
Date: |
Wed, 11 May 2022 17:58:01 -0400 (EDT) |
branch: externals/plz
commit 220f882ee4806904505aaeaaa014de0c2d874707
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>
Tests: (plz-post-jpeg-string) Add
---
tests/test-plz.el | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/tests/test-plz.el b/tests/test-plz.el
index 8ef261c3b8..d622fabc08 100644
--- a/tests/test-plz.el
+++ b/tests/test-plz.el
@@ -119,6 +119,22 @@
(should (string-match "curl" .headers.User-Agent))
(should (string= "value" (alist-get 'key (json-read-from-string
.data)))))))
+(ert-deftest plz-post-jpeg-string nil
+ (let* ((jpeg-string (plz-get-sync "https://httpbin.org/image/jpeg"
+ :as 'binary))
+ (response-jpeg)
+ (process (plz 'post "https://httpbin.org/post"
+ :headers '(("Content-Type" . "image/jpeg"))
+ :body jpeg-string
+ :as #'json-read
+ :then (lambda (json)
+ (setf response-jpeg
+ (base64-decode-string
+ (string-remove-prefix
"data:application/octet-stream;base64,"
+ (alist-get 'data
json))))))))
+ (plz-test-wait process)
+ (should (equal 'jpeg (image-type-from-data response-jpeg)))))
+
;; TODO: POST JSON buffer.
(ert-deftest plz-put-json-string nil
- [elpa] externals/plz 05f93b0b6b 25/81: Meta: Update Makefile, makem.sh, (continued)
- [elpa] externals/plz 05f93b0b6b 25/81: Meta: Update Makefile, makem.sh, ELPA Syncer, 2022/05/11
- [elpa] externals/plz 19a0110109 33/81: Notes: Add ToC, ELPA Syncer, 2022/05/11
- [elpa] externals/plz 9a1b119eff 38/81: Meta: Ignore sandbox/, ELPA Syncer, 2022/05/11
- [elpa] externals/plz 0301272d8d 40/81: Add: plz-put, ELPA Syncer, 2022/05/11
- [elpa] externals/plz a5f22b23e1 42/81: Add: (plz), ELPA Syncer, 2022/05/11
- [elpa] externals/plz 430ceffd1d 43/81: Change: Handle killed processes, ELPA Syncer, 2022/05/11
- [elpa] externals/plz f40d3ecbdd 47/81: Add/Change: :noquery argument for make-process, ELPA Syncer, 2022/05/11
- [elpa] externals/plz 1884d038ae 46/81: Notes: Add note about Lars Ingebrigtsen's with-url macro, ELPA Syncer, 2022/05/11
- [elpa] externals/plz 7478d43668 51/81: Revert "Add/Change: Handle LF-only HTTP responses", ELPA Syncer, 2022/05/11
- [elpa] externals/plz 8d2654bba7 49/81: Add/Change: Handle LF-only HTTP responses, ELPA Syncer, 2022/05/11
- [elpa] externals/plz 220f882ee4 53/81: Tests: (plz-post-jpeg-string) Add,
ELPA Syncer <=
- [elpa] externals/plz 4a246e24f6 54/81: Add: Upload binary files, ELPA Syncer, 2022/05/11
- [elpa] externals/plz 7c27e4bdcd 61/81: Change: Sync with accept-process-output, ELPA Syncer, 2022/05/11
- [elpa] externals/plz 65030d5cc1 64/81: Tidy: Docstring, ELPA Syncer, 2022/05/11
- [elpa] externals/plz dd92f48895 65/81: Change: Default to :then 'sync and :as 'string, ELPA Syncer, 2022/05/11
- [elpa] externals/plz cddccccf81 67/81: Docs: Fix link, ELPA Syncer, 2022/05/11
- [elpa] externals/plz f1a89a8816 68/81: Add: Download :as file, ELPA Syncer, 2022/05/11
- [elpa] externals/plz 8cd1ef481d 73/81: Notes: Add links to skeeto's feedback, ELPA Syncer, 2022/05/11
- [elpa] externals/plz dd491941ab 79/81: Meta: Update makem.sh, ELPA Syncer, 2022/05/11
- [elpa] externals/plz da503527d2 76/81: Change: (plz--response) Error if unable to parse HTTP response, ELPA Syncer, 2022/05/11
- [elpa] externals/plz 0a860d94dc 71/81: Tests: "There be dragons.", ELPA Syncer, 2022/05/11