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:
parent
359696e5e2
commit
cd1c603c8a
|
@ -44,20 +44,29 @@ system’s path."
|
||||||
(error (c)
|
(error (c)
|
||||||
(hunchentoot:stop server)
|
(hunchentoot:stop server)
|
||||||
c)))))
|
c)))))
|
||||||
|
|
||||||
|
(defun call-mirror-img ()
|
||||||
|
"Invoke MIRROR-IMG:MIRROR-IMG, using our own parameters.
|
||||||
|
Used in the tests MIRROR-IMG and MIRROR-IMG.ALREADY-DOWNLOADED."
|
||||||
|
(let* ((html-path (relative-pathname "t/testing-website/index.html"))
|
||||||
|
(download-dir (relative-pathname "t/tmp/"))
|
||||||
|
(html-url "http://localhost:4242")
|
||||||
|
(url-dir (pathname-utils:relative-pathname
|
||||||
|
(relative-pathname "t/")
|
||||||
|
download-dir)))
|
||||||
|
(mirror-img:mirror-img html-path download-dir
|
||||||
|
:url-dir url-dir
|
||||||
|
:html-url html-url)))
|
||||||
|
|
||||||
(define-test mirror-img (:tags '(mirror-img))
|
(define-test mirror-img (:tags '(mirror-img))
|
||||||
(assert-eq
|
(assert-eq
|
||||||
'T
|
'T
|
||||||
(stringp
|
(stringp (setq *mirror-img-result* (call-mirror-img)))))
|
||||||
(setq *mirror-img-result*
|
|
||||||
(let* ((html-path (relative-pathname "t/testing-website/index.html"))
|
(define-test mirror-img.already-downloaded (:tags '(mirror-img))
|
||||||
(download-dir (relative-pathname "t/tmp/"))
|
(assert-equal
|
||||||
(html-url "http://localhost:4242")
|
*mirror-img-result*
|
||||||
(url-dir (pathname-utils:relative-pathname
|
(call-mirror-img)))
|
||||||
(relative-pathname "t/")
|
|
||||||
download-dir)))
|
|
||||||
(mirror-img:mirror-img html-path download-dir
|
|
||||||
:url-dir url-dir
|
|
||||||
:html-url html-url))))))
|
|
||||||
|
|
||||||
(define-test mirror-img.files-mirrored (:tags '(mirror-img))
|
(define-test mirror-img.files-mirrored (:tags '(mirror-img))
|
||||||
(assert-equal
|
(assert-equal
|
||||||
|
|
Ŝarĝante…
Reference in New Issue