From 250d826f704b57fa03d4c47ca849fbe83309a108 Mon Sep 17 00:00:00 2001 From: Vivien Kraus Date: Wed, 5 May 2021 15:22:01 +0200 Subject: Add a server for an application --- tests/client-manifest-not-modified.scm | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/client-manifest-not-modified.scm (limited to 'tests/client-manifest-not-modified.scm') diff --git a/tests/client-manifest-not-modified.scm b/tests/client-manifest-not-modified.scm new file mode 100644 index 0000000..440c9b8 --- /dev/null +++ b/tests/client-manifest-not-modified.scm @@ -0,0 +1,28 @@ +(use-modules (webid-oidc client) + (webid-oidc testing) + (webid-oidc errors) + (web uri) + (srfi srfi-19) + (web request) + (web response) + (ice-9 optargs) + (ice-9 receive)) + +(with-test-environment + "client-manifest-not-modified" + (lambda () + (let ((handler (serve-application + (string->uri "https://example.com/manifest") + (string->uri "https://example.com/authorized")))) + (receive (response response-body) + (handler (build-request (string->uri "https://example.com/manifest")) + "") + (let ((etag (response-etag response))) + (unless etag + (exit 1)) + (receive (second-response second-response-body) + (handler (build-request (string->uri "https://example.com/manifest") + #:headers `((if-none-match . (,etag)))) + "") + (unless (eqv? (response-code second-response) 304) + (exit 2)))))))) -- cgit v1.2.3