From 81f036bfd23fb6e0f381ced2de27762fa9d1bb65 Mon Sep 17 00:00:00 2001 From: Maxime Devos Date: Thu, 6 Jan 2022 20:50:12 +0000 Subject: import/github: Test it. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Makefile.am (SCM_TESTS): Register new tests. * guix/import/github.scm (%github-api): New variable. (fetch-releases-or-tags): Use the new variable. * tests/import-github.scm: New file with tests. Signed-off-by: Ludovic Courtès --- guix/import/github.scm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'guix/import') diff --git a/guix/import/github.scm b/guix/import/github.scm index 1adfb8d281..8c1898c0c5 100644 --- a/guix/import/github.scm +++ b/guix/import/github.scm @@ -39,7 +39,10 @@ #:use-module (guix upstream) #:use-module (guix http-client) #:use-module (web uri) - #:export (%github-updater)) + #:export (%github-api %github-updater)) + +;; For tests. +(define %github-api (make-parameter "https://api.github.com")) (define (find-extension url) "Return the extension of the archive e.g. '.tar.gz' given a URL, or @@ -150,11 +153,11 @@ tags show up in the \"Releases\" tab of the web UI. For instance, 'https://api.github.com/repos/aconchillo/guile-json/releases' returns the empty list." (define release-url - (string-append "https://api.github.com/repos/" + (string-append (%github-api) "/repos/" (github-user-slash-repository url) "/releases")) (define tag-url - (string-append "https://api.github.com/repos/" + (string-append (%github-api) "/repos/" (github-user-slash-repository url) "/tags")) -- cgit v1.2.3