[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/plz-media-type c2c7f5f2ef 02/26: Add tests for DNS reso
From: |
ELPA Syncer |
Subject: |
[elpa] externals/plz-media-type c2c7f5f2ef 02/26: Add tests for DNS resolve errors |
Date: |
Wed, 1 May 2024 09:58:59 -0400 (EDT) |
branch: externals/plz-media-type
commit c2c7f5f2ef73df2b08756b19c5aad7d263c30bea
Author: Roman Scherer <roman@burningswell.com>
Commit: Roman Scherer <roman@burningswell.com>
Add tests for DNS resolve errors
---
tests/test-plz-media-type.el | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/tests/test-plz-media-type.el b/tests/test-plz-media-type.el
index fb24a28f42..33ac72cad1 100644
--- a/tests/test-plz-media-type.el
+++ b/tests/test-plz-media-type.el
@@ -359,6 +359,38 @@
(should (equal "Operation timeout." (cdr (plz-error-curl-error
plz-error))))
(should (< (time-to-seconds (time-subtract end-time start-time)) 1.1))))
+(ert-deftest plz-media-type-request-resolve-error-async ()
+ (let* ((else) (finally) (then)
+ (process (plz-media-type-request 'get
"https://httpbinnnnnn.org/get/status/404"
+ :as `(media-types ,plz-media-types)
+ :else (lambda (object) (push object else))
+ :finally (lambda () (push t finally))
+ :then (lambda (object) (push object then)))))
+ (plz-media-type-test-wait process)
+ (should (equal '(t) finally))
+ (should (equal 0 (length then)))
+ (should (equal 1 (length else)))
+ (seq-doseq (error else)
+ (should (plz-error-p error))
+ (should (null (plz-error-message error)))
+ (should (null (plz-error-response error)))
+ (equal '(6 . "Couldn't resolve host. The given remote host was not
resolved.")
+ (plz-error-curl-error error)))))
+
+(ert-deftest plz-media-type-request-resolve-error-sync ()
+ (let* ((result (condition-case error
+ (plz-media-type-request 'get
"https://httpbinnnnnn.org/get/status/404"
+ :as `(media-types ,plz-media-types))
+ (plz-error error))))
+ (should (equal 'plz-curl-error (car result)))
+ (should (equal "Curl error" (cadr result)))
+ (let ((error (caddr result)))
+ (should (plz-error-p error))
+ (should (null (plz-error-message error)))
+ (should (null (plz-error-response error)))
+ (equal '(6 . "Couldn't resolve host. The given remote host was not
resolved.")
+ (plz-error-curl-error error)))))
+
;;;; Footer
(provide 'test-plz-media-type)
- [elpa] externals/plz-media-type 12f3ab1477 12/26: Make plz-media-type--parse private, (continued)
- [elpa] externals/plz-media-type 12f3ab1477 12/26: Make plz-media-type--parse private, ELPA Syncer, 2024/05/01
- [elpa] externals/plz-media-type 4488497d71 09/26: Run handler code via a timer in the main loop, ELPA Syncer, 2024/05/01
- [elpa] externals/plz-media-type 8c0d9e14fa 25/26: ELPA preparations, ELPA Syncer, 2024/05/01
- [elpa] externals/plz-media-type 18109a6034 04/26: Add sync/async tests for application/x-ndjson, ELPA Syncer, 2024/05/01
- [elpa] externals/plz-media-type ff3f01eb60 19/26: Fix typo, ELPA Syncer, 2024/05/01
- [elpa] externals/plz-media-type 6192587659 22/26: Tweak vendor note, ELPA Syncer, 2024/05/01
- [elpa] externals/plz-media-type 218c98099f 17/26: Rename function to plz-media-type-decode-coding-string, ELPA Syncer, 2024/05/01
- [elpa] externals/plz-media-type 6c9cca634d 08/26: Parse response without widen, ELPA Syncer, 2024/05/01
- [elpa] externals/plz-media-type d7b1f616c4 18/26: Run tests on Emacs 29.3 as well, ELPA Syncer, 2024/05/01
- [elpa] externals/plz-media-type 0ddb38a356 13/26: Make plz-media-type-of-response private, ELPA Syncer, 2024/05/01
- [elpa] externals/plz-media-type c2c7f5f2ef 02/26: Add tests for DNS resolve errors,
ELPA Syncer <=
- [elpa] externals/plz-media-type ecd8628118 23/26: Depend on plz v0.8, ELPA Syncer, 2024/05/01
- [elpa] externals/plz-media-type 9f5177ca03 24/26: Add missing should, ELPA Syncer, 2024/05/01