diff options
Diffstat (limited to 'tests/cache-revalidate.scm')
-rw-r--r-- | tests/cache-revalidate.scm | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/tests/cache-revalidate.scm b/tests/cache-revalidate.scm index caa6e3e..a4eab3e 100644 --- a/tests/cache-revalidate.scm +++ b/tests/cache-revalidate.scm @@ -16,6 +16,7 @@ (use-modules (webid-oidc cache) (webid-oidc testing) + ((webid-oidc parameters) #:prefix p:) (web uri) (web request) (web response) @@ -44,15 +45,15 @@ (build-response #:code 304 #:reason-phrase "Not Modified" #:headers `((date . ,(time-utc->date (make-time time-utc 0 10))))) #f)) - (receive (response response-body) - (revalidate (string->uri "https://example.com") original-response "hello" - #:headers `((if-none-match . ("yyy" . #t)) - (if-unmodified-since . ,(time-utc->date (make-time time-utc 0 42))) - (user-agent . "Testbed")) - #:http-get backend) - (unless (eqv? (response-code response) 200) - (exit 5)) - (unless (equal? (response-headers response) - `((date . ,(time-utc->date (make-time time-utc 0 10))) - (content-type text/plain))) - (exit 6))))) + (parameterize ((p:anonymous-http-request backend)) + (receive (response response-body) + (revalidate (string->uri "https://example.com") original-response "hello" + #:headers `((if-none-match . ("yyy" . #t)) + (if-unmodified-since . ,(time-utc->date (make-time time-utc 0 42))) + (user-agent . "Testbed"))) + (unless (eqv? (response-code response) 200) + (exit 5)) + (unless (equal? (response-headers response) + `((date . ,(time-utc->date (make-time time-utc 0 10))) + (content-type text/plain))) + (exit 6)))))) |