self: System tests depend on CLI modules.
[jackhill/guix/guix.git] / tests / pypi.scm
index a132900..6daa44a 100644 (file)
@@ -20,7 +20,7 @@
 (define-module (test-pypi)
   #:use-module (guix import pypi)
   #:use-module (guix base32)
-  #:use-module (guix hash)
+  #:use-module (gcrypt hash)
   #:use-module (guix tests)
   #:use-module (guix build-system python)
   #:use-module ((guix build utils) #:select (delete-file-recursively which))
@@ -81,7 +81,7 @@ baz > 13.37")
    (dummy-package "foo"
                   (source (dummy-origin
                            (uri
-                            "https://pypi.io/packages/source/p/psutil/psutil-4.3.0.tar.gz"))))))
+                            "https://pypi.org/packages/source/p/psutil/psutil-4.3.0.tar.gz"))))))
 
 (test-equal "guix-package->pypi-name, new URL style"
   "certbot"
@@ -89,7 +89,7 @@ baz > 13.37")
    (dummy-package "foo"
                   (source (dummy-origin
                            (uri
-                            "https://pypi.python.org/packages/a2/3b/4756e6a0ceb14e084042a2a65c615d68d25621c6fd446d0fc10d14c4ce7d/certbot-0.8.1.tar.gz"))))))
+                            "https://pypi.org/packages/a2/3b/4756e6a0ceb14e084042a2a65c615d68d25621c6fd446d0fc10d14c4ce7d/certbot-0.8.1.tar.gz"))))))
 
 (test-equal "guix-package->pypi-name, several URLs"
   "cram"
@@ -118,9 +118,9 @@ baz > 13.37")
                ("https://example.com/foo-1.0.0-py2.py3-none-any.whl" #f)
                (_ (error "Unexpected URL: " url)))))
           (mock ((guix http-client) http-fetch
-                 (lambda (url)
+                 (lambda (url . rest)
                    (match url
-                     ("https://pypi.python.org/pypi/foo/json"
+                     ("https://pypi.org/pypi/foo/json"
                       (values (open-input-string test-json)
                               (string-length test-json)))
                      ("https://example.com/foo-1.0.0-py2.py3-none-any.whl" #f)
@@ -131,8 +131,7 @@ baz > 13.37")
                      ('version "1.0.0")
                      ('source ('origin
                                 ('method 'url-fetch)
-                                ('uri (string-append "https://example.com/foo-"
-                                                     version ".tar.gz"))
+                                ('uri ('pypi-uri "foo" 'version))
                                 ('sha256
                                  ('base32
                                   (? string? hash)))))
@@ -181,9 +180,9 @@ baz > 13.37")
                  (delete-file-recursively "foo-1.0.0.dist-info")))
              (_ (error "Unexpected URL: " url)))))
         (mock ((guix http-client) http-fetch
-               (lambda (url)
+               (lambda (url . rest)
                  (match url
-                   ("https://pypi.python.org/pypi/foo/json"
+                   ("https://pypi.org/pypi/foo/json"
                     (values (open-input-string test-json)
                             (string-length test-json)))
                    ("https://example.com/foo-1.0.0-py2.py3-none-any.whl" #f)
@@ -194,8 +193,7 @@ baz > 13.37")
                    ('version "1.0.0")
                    ('source ('origin
                               ('method 'url-fetch)
-                              ('uri (string-append "https://example.com/foo-"
-                                                   version ".tar.gz"))
+                              ('uri ('pypi-uri "foo" 'version))
                               ('sha256
                                ('base32
                                 (? string? hash)))))