aboutsummaryrefslogtreecommitdiff
path: root/tests/pypi.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-02-08 15:58:36 +0100
committerLudovic Courtès <ludo@gnu.org>2017-02-08 16:17:05 +0100
commit4eaac4b722b180b433b75127a30b871aaf9f0913 (patch)
tree07709e7514f1db6fd9aadaeb8cd1fb74b3717189 /tests/pypi.scm
parent750a423996f3471aa4807609256f686c8ebf5584 (diff)
downloadguix-4eaac4b722b180b433b75127a30b871aaf9f0913.tar
guix-4eaac4b722b180b433b75127a30b871aaf9f0913.tar.gz
import: pypi: Correctly handle multiple-URL origins.
Fixes <https://bugs.gnu.org/25635>. Reported by Sergei Trofimovich <slyfox@inbox.ru>. * guix/import/pypi.scm (guix-package->pypi-name)[url->pypi-name]: New procedure. Rewrite body to match lists in addition to strings. * tests/pypi.scm ("guix-package->pypi-name, several URLs"): New test.
Diffstat (limited to 'tests/pypi.scm')
-rw-r--r--tests/pypi.scm10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/pypi.scm b/tests/pypi.scm
index 447c23ee95..a132900566 100644
--- a/tests/pypi.scm
+++ b/tests/pypi.scm
@@ -22,6 +22,7 @@
#:use-module (guix base32)
#:use-module (guix hash)
#:use-module (guix tests)
+ #:use-module (guix build-system python)
#:use-module ((guix build utils) #:select (delete-file-recursively which))
#:use-module (srfi srfi-64)
#:use-module (ice-9 match))
@@ -90,6 +91,15 @@ baz > 13.37")
(uri
"https://pypi.python.org/packages/a2/3b/4756e6a0ceb14e084042a2a65c615d68d25621c6fd446d0fc10d14c4ce7d/certbot-0.8.1.tar.gz"))))))
+(test-equal "guix-package->pypi-name, several URLs"
+ "cram"
+ (guix-package->pypi-name
+ (dummy-package "foo"
+ (source
+ (dummy-origin
+ (uri (list "https://bitheap.org/cram/cram-0.7.tar.gz"
+ (pypi-uri "cram" "0.7"))))))))
+
(test-assert "pypi->guix-package"
;; Replace network resources with sample data.
(mock ((guix import utils) url-fetch