[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/plz 3249835c8b 18/81: Tidy tests
From: |
ELPA Syncer |
Subject: |
[elpa] externals/plz 3249835c8b 18/81: Tidy tests |
Date: |
Wed, 11 May 2022 17:57:58 -0400 (EDT) |
branch: externals/plz
commit 3249835c8b0712e8d498731a609a2fb60781c903
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>
Tidy tests
---
tests/test-plz.el | 27 ++++++++++-----------------
1 file changed, 10 insertions(+), 17 deletions(-)
diff --git a/tests/test-plz.el b/tests/test-plz.el
index 071730e8cf..6f82e78c2f 100644
--- a/tests/test-plz.el
+++ b/tests/test-plz.el
@@ -71,9 +71,7 @@
:as 'string
:then (lambda (string)
(setf test-string string)))))
- (cl-loop for i upto 100 ;; 10 seconds
- while (equal 'run (process-status process))
- do (sleep-for 0.1))
+ (plz-test-wait process)
(string-match "curl" test-string))))
(ert-deftest plz-get-buffer nil
@@ -84,9 +82,7 @@
:then (lambda (buffer)
(with-current-buffer buffer
(setf test-buffer-string
(buffer-string)))))))
- (cl-loop for i upto 100 ;; 10 seconds
- while (equal 'run (process-status process))
- do (sleep-for 0.1))
+ (plz-test-wait process)
(string-match "curl" test-buffer-string))))
(ert-deftest plz-get-response nil
@@ -95,9 +91,7 @@
:as 'response
:then (lambda (response)
(setf test-response response)))))
- (cl-loop for i upto 100 ;; 10 seconds
- while (equal 'run (process-status process))
- do (sleep-for 0.1))
+ (plz-test-wait process)
(plz-test-get-response test-response))))
(ert-deftest plz-get-json nil
@@ -106,9 +100,7 @@
:as #'json-read
:then (lambda (json)
(setf test-json json)))))
- (cl-loop for i upto 100 ;; 10 seconds
- while (equal 'run (process-status process))
- do (sleep-for 0.1))
+ (plz-test-wait process)
(let* ((headers (alist-get 'headers test-json))
(user-agent (alist-get 'User-Agent headers nil nil
#'equal)))
(string-match "curl" user-agent)))))
@@ -158,10 +150,6 @@
;;;;; Binary
(ert-deftest plz-test-get-jpeg ()
- (let ((jpeg (plz-get-sync "https://httpbin.org/image/jpeg"
- :decode nil)))
- (should (image-jpeg-p jpeg)))
-
(let* ((test-jpeg)
(process (plz-get "https://httpbin.org/image/jpeg"
:decode nil
@@ -169,7 +157,12 @@
:then (lambda (string)
(setf test-jpeg string)))))
(plz-test-wait process)
- (should (image-jpeg-p test-jpeg))))
+ (should (equal 'jpeg (image-type-from-data test-jpeg)))))
+
+(ert-deftest plz-test-get-jpeg-sync ()
+ (let ((jpeg (plz-get-sync "https://httpbin.org/image/jpeg"
+ :decode nil)))
+ (should (equal 'jpeg (image-type-from-data jpeg)))))
;;;; Footer
- [elpa] externals/plz f0a0d114a6 01/81: Initial commit, (continued)
- [elpa] externals/plz f0a0d114a6 01/81: Initial commit, ELPA Syncer, 2022/05/11
- [elpa] externals/plz 2d20ca5030 02/81: Changes, ELPA Syncer, 2022/05/11
- [elpa] externals/plz 5f54b5ebec 06/81: Changes, ELPA Syncer, 2022/05/11
- [elpa] externals/plz 1016279174 07/81: Changes, ELPA Syncer, 2022/05/11
- [elpa] externals/plz 897c5bbfb2 13/81: Improvements, error handling, ELPA Syncer, 2022/05/11
- [elpa] externals/plz e14ea7327d 14/81: Tidying, ELPA Syncer, 2022/05/11
- [elpa] externals/plz 2b7944e0f9 05/81: Changes, ELPA Syncer, 2022/05/11
- [elpa] externals/plz 950a5498cb 16/81: Tidy, ELPA Syncer, 2022/05/11
- [elpa] externals/plz 44e6f02064 17/81: Binary content, ELPA Syncer, 2022/05/11
- [elpa] externals/plz 5bd683ead8 19/81: Tidy tests, ELPA Syncer, 2022/05/11
- [elpa] externals/plz 3249835c8b 18/81: Tidy tests,
ELPA Syncer <=
- [elpa] externals/plz 21a7318f1c 26/81: Tests: Tidy/rename, ELPA Syncer, 2022/05/11
- [elpa] externals/plz 3dd2598fe9 24/81: Tidy, ELPA Syncer, 2022/05/11
- [elpa] externals/plz 3cc6747035 28/81: Meta: Add comm keyword, ELPA Syncer, 2022/05/11
- [elpa] externals/plz 51404566fa 29/81: Notes: Add fetch.el, ELPA Syncer, 2022/05/11
- [elpa] externals/plz b77283748b 31/81: Meta: Update makem.sh, ELPA Syncer, 2022/05/11
- [elpa] externals/plz 56c66c4421 32/81: Add/Change: :as 'binary, ELPA Syncer, 2022/05/11
- [elpa] externals/plz 1bb701f1c1 36/81: Change/Fix: Downcase and intern header keys, ELPA Syncer, 2022/05/11
- [elpa] externals/plz 6f8dfb83de 34/81: Tests: (plz-test-get-response) Change to macro, ELPA Syncer, 2022/05/11
- [elpa] externals/plz baf93bb80a 39/81: Fix: (plz--curl) Header args, ELPA Syncer, 2022/05/11
- [elpa] externals/plz 33438b7105 35/81: CI: Enable testing of all branches, ELPA Syncer, 2022/05/11