Add additional MIRROR-IMG test

This one makes sure output is the same, regardless
as to whether or not files have already been
mirrored.
This commit is contained in:
Jaidyn Ann 2024-05-31 23:22:14 -05:00
parent 359696e5e2
commit cd1c603c8a

View File

@ -44,11 +44,10 @@ systems path."
(error (c) (error (c)
(hunchentoot:stop server) (hunchentoot:stop server)
c))))) c)))))
(define-test mirror-img (:tags '(mirror-img))
(assert-eq (defun call-mirror-img ()
'T "Invoke MIRROR-IMG:MIRROR-IMG, using our own parameters.
(stringp Used in the tests MIRROR-IMG and MIRROR-IMG.ALREADY-DOWNLOADED."
(setq *mirror-img-result*
(let* ((html-path (relative-pathname "t/testing-website/index.html")) (let* ((html-path (relative-pathname "t/testing-website/index.html"))
(download-dir (relative-pathname "t/tmp/")) (download-dir (relative-pathname "t/tmp/"))
(html-url "http://localhost:4242") (html-url "http://localhost:4242")
@ -57,7 +56,17 @@ systems path."
download-dir))) download-dir)))
(mirror-img:mirror-img html-path download-dir (mirror-img:mirror-img html-path download-dir
:url-dir url-dir :url-dir url-dir
:html-url html-url)))))) :html-url html-url)))
(define-test mirror-img (:tags '(mirror-img))
(assert-eq
'T
(stringp (setq *mirror-img-result* (call-mirror-img)))))
(define-test mirror-img.already-downloaded (:tags '(mirror-img))
(assert-equal
*mirror-img-result*
(call-mirror-img)))
(define-test mirror-img.files-mirrored (:tags '(mirror-img)) (define-test mirror-img.files-mirrored (:tags '(mirror-img))
(assert-equal (assert-equal