This commit is contained in:
blankie 2022-10-09 14:25:08 +07:00
parent 99be807b73
commit bab6c56205
Signed by: blankie
GPG key ID: CC15FC822C7F61F5

View file

@ -45,12 +45,12 @@
(require rackunit)
(parameterize ([(config-parameter 'strict_proxy) "true"])
(check-equal? (get-media-html "https://static.wikia.nocookie.net/a" "image/jpeg") `(img (@ (src "/proxy?dest=https%3A%2F%2Fstatic.wikia.nocookie.net%2Fa"))))
(check-equal? (get-media-html "https://static.wikia.nocookie.net/b" "audio/mp3") `(audio (@ (src "/proxy?dest=https%3A%2F%2Fstatic.wikia.nocookie.net%2Fb")))))
(check-equal? (get-media-html "https://static.wikia.nocookie.net/b" "audio/mp3") `(audio (@ (src "/proxy?dest=https%3A%2F%2Fstatic.wikia.nocookie.net%2Fb") (controls)))))
(parameterize ([(config-parameter 'strict_proxy) "no"])
(check-equal? (get-media-html "https://static.wikia.nocookie.net/c" "application/ogg") `(audio (@ (src "/proxy?dest=https%3A%2F%2Fstatic.wikia.nocookie.net%2Fc"))))
(check-equal? (get-media-html "https://static.wikia.nocookie.net/d" "video/mp4") `(video (@ (src "/proxy?dest=https%3A%2F%2Fstatic.wikia.nocookie.net%2Fd")))))
(check-equal? (get-media-html "https://static.wikia.nocookie.net/c" "application/ogg") `(audio (@ (src "/proxy?dest=https%3A%2F%2Fstatic.wikia.nocookie.net%2Fc") (controls))))
(check-equal? (get-media-html "https://static.wikia.nocookie.net/d" "video/mp4") `(video (@ (src "/proxy?dest=https%3A%2F%2Fstatic.wikia.nocookie.net%2Fd") (controls)))))
(check-equal? (get-media-html "https://example.com" "who knows") `"")
(check-equal? (get-media-html #f "who knows") `""))
(check-equal? (get-media-html "https://example.com" #f) `""))
(define (generate-results-page #:source-url source-url
#:wikiname wikiname