Skip to content

Commit

Permalink
Tests: (plz-head-temp-file) Add
Browse files Browse the repository at this point in the history
  • Loading branch information
josephmturner committed Aug 16, 2024
1 parent 570eae7 commit 60c8e3f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test-plz.el
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,16 @@ in URL-encoded form)."
;; It's a temp file, so it should always be deleted.
(delete-file filename))))

(plz-deftest plz-head-temp-file ()
(let ((filename (plz 'head (url "/image/jpeg")
:as 'file :then 'sync)))
(unwind-protect
(with-temp-buffer
(insert-file-contents filename)
(should (re-search-forward "Content-Type: image/jpeg")))
;; It's a temp file, so it should always be deleted.
(delete-file filename))))

(plz-deftest plz-get-named-file ()
(let ((filename (make-temp-file "plz-")))
;; HACK: Delete the temp file and reuse its name, because
Expand Down

0 comments on commit 60c8e3f

Please sign in to comment.