tests: elpa: Don't actually download files.

* tests/elpa.scm (eval-test-with-elpa): Mock 'url-fetch'.
master
Ludovic Courtès 2018-03-18 22:33:41 +01:00
parent 9bb1838c3f
commit 17cdd3d0fe
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 25 additions and 18 deletions

View File

@ -81,24 +81,31 @@ information about package NAME. (Function 'elpa-package-info'.)"
auctex-readme-mock auctex-readme-mock
url))) url)))
(_ #f))))) (_ #f)))))
(match (elpa->guix-package pkg) (mock
(('package ((guix build download) url-fetch
('name "emacs-auctex") (lambda (url file . _)
('version "11.88.6") (call-with-output-file file
('source (lambda (port)
('origin (display "fake tarball" port)))))
('method 'url-fetch)
('uri ('string-append (match (elpa->guix-package pkg)
"https://elpa.gnu.org/packages/auctex-" 'version ".tar")) (('package
('sha256 ('base32 (? string? hash))))) ('name "emacs-auctex")
('build-system 'emacs-build-system) ('version "11.88.6")
('home-page "http://www.gnu.org/software/auctex/") ('source
('synopsis "Integrated environment for *TeX*") ('origin
('description (? string?)) ('method 'url-fetch)
('license 'license:gpl3+)) ('uri ('string-append
#t) "https://elpa.gnu.org/packages/auctex-" 'version ".tar"))
(x ('sha256 ('base32 (? string? hash)))))
(pk 'fail x #f))))) ('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" (test-assert "elpa->guix-package test 1"
(eval-test-with-elpa "auctex")) (eval-test-with-elpa "auctex"))