[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/plz 6f8dfb83de 34/81: Tests: (plz-test-get-response) Ch
From: |
ELPA Syncer |
Subject: |
[elpa] externals/plz 6f8dfb83de 34/81: Tests: (plz-test-get-response) Change to macro |
Date: |
Wed, 11 May 2022 17:58:00 -0400 (EDT) |
branch: externals/plz
commit 6f8dfb83deeaec7b25f184522a6e301f5add64ba
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>
Tests: (plz-test-get-response) Change to macro
Not sure why these two tests are failing on CI but passing locally.
Testing each part individually should help.
---
tests/test-plz.el | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/tests/test-plz.el b/tests/test-plz.el
index 66d5928750..17070866e7 100644
--- a/tests/test-plz.el
+++ b/tests/test-plz.el
@@ -51,16 +51,16 @@
;;;; Functions
-(defun plz-test-get-response (response)
- "Return non-nil if RESPONSE seems to be a correct GET response."
- (and (plz-response-p response)
- (numberp (plz-response-version response))
- (eq 200 (plz-response-status response))
- (equal "application/json" (alist-get "Content-Type"
(plz-response-headers response) nil nil #'equal))
- (let* ((json (json-read-from-string (plz-response-body response)))
- (headers (alist-get 'headers json))
- (user-agent (alist-get 'User-Agent headers nil nil #'equal)))
- (string-match "curl" user-agent))))
+(defmacro plz-test-get-response (response)
+ "Test parts of RESPONSE with `should'."
+ `(and (should (plz-response-p ,response))
+ (should (numberp (plz-response-version ,response)))
+ (should (eq 200 (plz-response-status ,response)))
+ (should (equal "application/json" (alist-get "Content-Type"
(plz-response-headers ,response) nil nil #'equal)))
+ (let* ((json (json-read-from-string (plz-response-body ,response)))
+ (headers (alist-get 'headers json))
+ (user-agent (alist-get 'User-Agent headers nil nil #'equal)))
+ (should (string-match "curl" user-agent)))))
;;;; Tests
@@ -93,7 +93,7 @@
:then (lambda (response)
(setf test-response response)))))
(plz-test-wait process)
- (should (plz-test-get-response test-response))))
+ (plz-test-get-response test-response)))
(ert-deftest plz-get-json nil
(let* ((test-json)
@@ -113,8 +113,8 @@
(should (string-match "curl" (plz-get-sync "https://httpbin.org/get"))))
(ert-deftest plz-get-response-sync nil
- (should (plz-test-get-response (plz-get-sync "https://httpbin.org/get"
- :as 'response))))
+ (plz-test-get-response (plz-get-sync "https://httpbin.org/get"
+ :as 'response)))
(ert-deftest plz-get-json-sync nil
(let-alist (plz-get-sync "https://httpbin.org/get"
- [elpa] externals/plz 44e6f02064 17/81: Binary content, (continued)
- [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, 2022/05/11
- [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 <=
- [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
- [elpa] externals/plz 439fb383d9 37/81: Notes: Add idea about finalizers, ELPA Syncer, 2022/05/11
- [elpa] externals/plz 65dbc0f219 41/81: Change/Fix: (plz--sentinel) Use exhaustive pcase, ELPA Syncer, 2022/05/11
- [elpa] externals/plz 7eff40f276 44/81: Add: plz-finally, ELPA Syncer, 2022/05/11
- [elpa] externals/plz 27010c20e1 45/81: Meta: Update makem.sh, etc., ELPA Syncer, 2022/05/11
- [elpa] externals/plz f34efa052c 48/81: Fix: set-buffer-multibyte nil for binary, ELPA Syncer, 2022/05/11
- [elpa] externals/plz e977a046a3 50/81: Change: (plz-http-response-status-line-regexp) Match at BOL, ELPA Syncer, 2022/05/11
- [elpa] externals/plz f12f907719 52/81: Change/Fix: (plz--curl) Disable Expect header, ELPA Syncer, 2022/05/11
- [elpa] externals/plz 701e79c3e8 55/81: Tidy: Remove obsolete functions, ELPA Syncer, 2022/05/11