Skip to content

Commit db6c229

Browse files
committed
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.
1 parent df1814b commit db6c229

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

testing/lisp/test-org.el

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3439,17 +3439,18 @@ SCHEDULED: <2017-05-06 Sat>
34393439
(progn (org-file-contents "this-file-must-not-exist" :noerror) t))
34403440
;; Open URL.
34413441
(should
3442-
(string= "foo"
3443-
(let ((buffer (generate-new-buffer "url-retrieve-output")))
3444-
(unwind-protect
3445-
;; Simulate successful retrieval of a URL.
3446-
(cl-letf (((symbol-function 'url-retrieve-synchronously)
3447-
(lambda (&rest_)
3448-
(with-current-buffer buffer
3449-
(insert "HTTP/1.1 200 OK\n\nfoo"))
3450-
buffer)))
3451-
(org-file-contents "http://some-valid-url"))
3452-
(kill-buffer buffer)))))
3442+
(let ((org-resource-download-policy t))
3443+
(string= "foo"
3444+
(let ((buffer (generate-new-buffer "url-retrieve-output")))
3445+
(unwind-protect
3446+
;; Simulate successful retrieval of a URL.
3447+
(cl-letf (((symbol-function 'url-retrieve-synchronously)
3448+
(lambda (&rest_)
3449+
(with-current-buffer buffer
3450+
(insert "HTTP/1.1 200 OK\n\nfoo"))
3451+
buffer)))
3452+
(org-file-contents "http://some-valid-url"))
3453+
(kill-buffer buffer))))))
34533454
;; Throw error when trying to access an invalid URL.
34543455
(should-error
34553456
(let ((buffer (generate-new-buffer "url-retrieve-output")))

testing/lisp/test-ox.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,8 @@ num:2 <:active")))
238238
(org-export--get-inbuffer-options))
239239
'(:language "fr" :select-tags ("a" "b" "c") :title ("a b c"))))
240240
;; Options set through SETUPFILE specified using a URL.
241-
(let ((buffer (generate-new-buffer "url-retrieve-output")))
241+
(let ((buffer (generate-new-buffer "url-retrieve-output"))
242+
(org-resource-download-policy t))
242243
(unwind-protect
243244
;; Simulate successful retrieval of a setupfile from URL.
244245
(cl-letf (((symbol-function 'url-retrieve-synchronously)

0 commit comments

Comments
 (0)