diff options
author | Vivien Kraus <vivien@planete-kraus.eu> | 2021-05-05 15:22:01 +0200 |
---|---|---|
committer | Vivien Kraus <vivien@planete-kraus.eu> | 2021-06-19 15:44:36 +0200 |
commit | 7b97db1634394f90e653d0cd25bc45ce770b10f3 (patch) | |
tree | 49ef000fb158f1087c95bd4a13eea20c3565e137 /tests | |
parent | 3f66c5a713694d6acf8ce66319fe9719539d2a37 (diff) |
Add a server for an application
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 3 | ||||
-rw-r--r-- | tests/client-manifest-not-modified.scm | 28 |
2 files changed, 30 insertions, 1 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index 52a0083..5ec6e49 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -39,7 +39,8 @@ TESTS = %reldir%/load-library.scm \ %reldir%/provider-confirmation.scm \ %reldir%/resource-server.scm \ %reldir%/client-authorization.scm \ - %reldir%/client-token.scm + %reldir%/client-token.scm \ + %reldir%/client-manifest-not-modified.scm EXTRA_DIST += $(TESTS) %reldir%/ChangeLog 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)))))))) |