branch: externals/org
commit 8e2ed45bb184c6620f10169aa9658ff334e6e0e1
Author: Ihor Radchenko <yanta...@posteo.net>
Commit: Ihor Radchenko <yanta...@posteo.net>

    test-org/file-contents: Refactor duplicate test
    
    * testing/lisp/test-org.el (test-org/file-contents): Avoid safety
    prompt when testing.  Fix duplicate test testing optional argument for
    `org-file-contents' (the argument were not passed previously).
---
 testing/lisp/test-org.el | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index 822cbc67a7..337367c0bb 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -3982,8 +3982,9 @@ SCHEDULED: <2017-05-06 Sat>
                       (org-file-contents "http://some-valid-url";))
                   (kill-buffer buffer))))))
   ;; Throw error when trying to access an invalid URL.
-  (should-error
-   (let ((buffer (generate-new-buffer "url-retrieve-output")))
+  (should-not
+   (let ((buffer (generate-new-buffer "url-retrieve-output"))
+         (org-resource-download-policy t))
      (unwind-protect
         ;; Simulate unsuccessful retrieval of a URL.
         (cl-letf (((symbol-function 'url-retrieve-synchronously)
@@ -3991,11 +3992,12 @@ SCHEDULED: <2017-05-06 Sat>
                      (with-current-buffer buffer
                        (insert "HTTP/1.1 404 Not found\n\ndoes not matter"))
                      buffer)))
-          (org-file-contents "http://this-url-must-not-exist";))
+          (org-file-contents "http://this-url-must-not-exist"; 'noerror))
        (kill-buffer buffer))))
   ;; Try to access an invalid URL, but do not throw an error.
   (should-error
-   (let ((buffer (generate-new-buffer "url-retrieve-output")))
+   (let ((buffer (generate-new-buffer "url-retrieve-output"))
+         (org-resource-download-policy t))
      (unwind-protect
         ;; Simulate unsuccessful retrieval of a URL.
         (cl-letf (((symbol-function 'url-retrieve-synchronously)
@@ -4006,7 +4008,8 @@ SCHEDULED: <2017-05-06 Sat>
           (org-file-contents "http://this-url-must-not-exist";))
        (kill-buffer buffer))))
   (should
-   (let ((buffer (generate-new-buffer "url-retrieve-output")))
+   (let ((buffer (generate-new-buffer "url-retrieve-output"))
+         (org-resource-download-policy t))
      (unwind-protect
         ;; Simulate unsuccessful retrieval of a URL.
         (cl-letf (((symbol-function 'url-retrieve-synchronously)

Reply via email to