diff options
author | Mathieu Othacehe <othacehe@gnu.org> | 2020-09-02 10:43:22 +0200 |
---|---|---|
committer | Mathieu Othacehe <othacehe@gnu.org> | 2020-09-02 10:43:22 +0200 |
commit | b135a02bf22a59f5d8b916b5068961e774fb44b5 (patch) | |
tree | ae49edec505aed14bd3edabe80d24faf0f703ee0 /tests | |
parent | 83ac1a84f5a5f1af4c6a81de55b66cb3a2b4cdc5 (diff) | |
download | cuirass-b135a02bf22a59f5d8b916b5068961e774fb44b5.tar cuirass-b135a02bf22a59f5d8b916b5068961e774fb44b5.tar.gz |
Fix /specifications route.
Fixes <https://issues.guix.gnu.org/43163>.
* src/cuirass/http.scm (specification->json-object): New procedure,
(url-handler): use it for "/specifications" route to convert specification
objects into a representation suitable for json->scm.
* tests/http.scm ("/specifications"): Test the above route.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/http.scm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/http.scm b/tests/http.scm index f1d6e46..f80e515 100644 --- a/tests/http.scm +++ b/tests/http.scm @@ -192,6 +192,15 @@ (db-add-evaluation "guix" checkouts1) (db-add-evaluation "guix" checkouts2))) + (test-assert "/specifications" + (match (call-with-input-string + (utf8->string + (http-get-body (test-cuirass-uri "/specifications"))) + json->scm) + (#(spec) + (and (string=? (assoc-ref spec "name") "guix") + (vector? (assoc-ref spec "package-path-inputs")))))) + (test-assert "/build/1" (lset= equal? (call-with-input-string |