summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-03-18 22:33:41 +0100
committerLudovic Courtès <ludo@gnu.org>2018-03-18 22:33:41 +0100
commit17cdd3d0fe1987d0272f2c3496123be1ef772d6b (patch)
tree89499ff497c5cd9921bea754ce74c6972c87a7c3 /tests
parent9bb1838c3f982dfb84ba24eb2f727cb39ee5805c (diff)
downloadguix-17cdd3d0fe1987d0272f2c3496123be1ef772d6b.tar.gz
tests: elpa: Don't actually download files.
* tests/elpa.scm (eval-test-with-elpa): Mock 'url-fetch'.
Diffstat (limited to 'tests')
-rw-r--r--tests/elpa.scm43
1 files changed, 25 insertions, 18 deletions
diff --git a/tests/elpa.scm b/tests/elpa.scm
index e6d53c892e..44e3914f2e 100644
--- a/tests/elpa.scm
+++ b/tests/elpa.scm
@@ -81,24 +81,31 @@ information about package NAME. (Function 'elpa-package-info'.)"
                                 auctex-readme-mock
                                 url)))
           (_ #f)))))
-   (match (elpa->guix-package pkg)
-     (('package
-        ('name "emacs-auctex")
-        ('version "11.88.6")
-        ('source
-         ('origin
-           ('method 'url-fetch)
-           ('uri ('string-append
-                  "https://elpa.gnu.org/packages/auctex-" 'version ".tar"))
-           ('sha256 ('base32 (? string? hash)))))
-        ('build-system 'emacs-build-system)
-        ('home-page "http://www.gnu.org/software/auctex/")
-        ('synopsis "Integrated environment for *TeX*")
-        ('description (? string?))
-        ('license 'license:gpl3+))
-      #t)
-     (x
-      (pk 'fail x #f)))))
+   (mock
+    ((guix build download) url-fetch
+     (lambda (url file . _)
+       (call-with-output-file file
+         (lambda (port)
+           (display "fake tarball" port)))))
+
+    (match (elpa->guix-package pkg)
+      (('package
+         ('name "emacs-auctex")
+         ('version "11.88.6")
+         ('source
+          ('origin
+            ('method 'url-fetch)
+            ('uri ('string-append
+                   "https://elpa.gnu.org/packages/auctex-" 'version ".tar"))
+            ('sha256 ('base32 (? string? hash)))))
+         ('build-system 'emacs-build-system)
+         ('home-page "http://www.gnu.org/software/auctex/")
+         ('synopsis "Integrated environment for *TeX*")
+         ('description (? string?))
+         ('license 'license:gpl3+))
+       #t)
+      (x
+       (pk 'fail x #f))))))
 
 (test-assert "elpa->guix-package test 1"
   (eval-test-with-elpa "auctex"))