Browse Source

testing/lisp: Update to handle new download policy

* testing/lisp/test-ox.el: Bind `org-resource-download-policy' to t when
testing downloading.

* testing/lisp/test-org.el: Bind `org-resource-download-policy' to t
when testing downloading.
TEC 2 years ago
parent
commit
db6c229786
2 changed files with 14 additions and 12 deletions
  1. 12 11
      testing/lisp/test-org.el
  2. 2 1
      testing/lisp/test-ox.el

+ 12 - 11
testing/lisp/test-org.el

@@ -3439,17 +3439,18 @@ SCHEDULED: <2017-05-06 Sat>
    (progn (org-file-contents "this-file-must-not-exist" :noerror) t))
   ;; Open URL.
   (should
-   (string= "foo"
-	    (let ((buffer (generate-new-buffer "url-retrieve-output")))
-	      (unwind-protect
-		  ;; Simulate successful retrieval of a URL.
-		  (cl-letf (((symbol-function 'url-retrieve-synchronously)
-			     (lambda (&rest_)
-			       (with-current-buffer buffer
-				 (insert "HTTP/1.1 200 OK\n\nfoo"))
-			       buffer)))
-		    (org-file-contents "http://some-valid-url"))
-		(kill-buffer buffer)))))
+   (let ((org-resource-download-policy t))
+     (string= "foo"
+              (let ((buffer (generate-new-buffer "url-retrieve-output")))
+                (unwind-protect
+                    ;; Simulate successful retrieval of a URL.
+                    (cl-letf (((symbol-function 'url-retrieve-synchronously)
+                               (lambda (&rest_)
+                                 (with-current-buffer buffer
+                                   (insert "HTTP/1.1 200 OK\n\nfoo"))
+                                 buffer)))
+                      (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")))

+ 2 - 1
testing/lisp/test-ox.el

@@ -238,7 +238,8 @@ num:2 <:active")))
       (org-export--get-inbuffer-options))
     '(:language "fr" :select-tags ("a" "b" "c") :title ("a b c"))))
   ;; Options set through SETUPFILE specified using a URL.
-  (let ((buffer (generate-new-buffer "url-retrieve-output")))
+  (let ((buffer (generate-new-buffer "url-retrieve-output"))
+        (org-resource-download-policy t))
     (unwind-protect
 	;; Simulate successful retrieval of a setupfile from URL.
 	(cl-letf (((symbol-function 'url-retrieve-synchronously)