tests: Mock up http-fetch in import test.
This is a follow-up to commit 63773200d7
.
* tests/pypi.scm ("pypi->guix-package, wheels"): Add mock definition of
"http-fetch".
This commit is contained in:
parent
36a318adc7
commit
239f46325d
@ -148,10 +148,6 @@ baz > 13.37")
|
||||
(mock ((guix import utils) url-fetch
|
||||
(lambda (url file-name)
|
||||
(match url
|
||||
("https://pypi.python.org/pypi/foo/json"
|
||||
(with-output-to-file file-name
|
||||
(lambda ()
|
||||
(display test-json))))
|
||||
("https://example.com/foo-1.0.0.tar.gz"
|
||||
(begin
|
||||
(mkdir "foo-1.0.0")
|
||||
@ -175,6 +171,14 @@ baz > 13.37")
|
||||
(rename-file zip-file file-name))
|
||||
(delete-file-recursively "foo-1.0.0.dist-info")))
|
||||
(_ (error "Unexpected URL: " url)))))
|
||||
(mock ((guix http-client) http-fetch
|
||||
(lambda (url)
|
||||
(match url
|
||||
("https://pypi.python.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)
|
||||
(_ (error "Unexpected URL: " url)))))
|
||||
(match (pypi->guix-package "foo")
|
||||
(('package
|
||||
('name "python-foo")
|
||||
@ -200,6 +204,6 @@ baz > 13.37")
|
||||
test-source-hash)
|
||||
hash))
|
||||
(x
|
||||
(pk 'fail x #f)))))
|
||||
(pk 'fail x #f))))))
|
||||
|
||||
(test-end "pypi")
|
||||
|
Loading…
Reference in New Issue
Block a user