summaryrefslogtreecommitdiff
path: root/guix/import
diff options
context:
space:
mode:
authorMaxime Devos <maximedevos@telenet.be>2022-01-06 20:50:12 +0000
committerLudovic Courtès <ludo@gnu.org>2022-01-16 23:56:56 +0100
commit81f036bfd23fb6e0f381ced2de27762fa9d1bb65 (patch)
tree0fbdfaf7bc42e0354a9b015d8ec50d8e66d4fd3f /guix/import
parentf8306a501935f8012fba76a9de924f512c24883a (diff)
import/github: Test it.
* 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 <ludo@gnu.org>
Diffstat (limited to 'guix/import')
-rw-r--r--guix/import/github.scm9
1 files changed, 6 insertions, 3 deletions
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"))