tests: Allow opam test to run without networking.
Fixes a regression introduced in
fc29c80b96
, where, since
'get-opam-repository' was no longer mocked, the test would try to access
the actual OPAM repository through a call to 'http-fetch/cached'; this
would lead to a test failure when networking is unavailable.
* tests/opam.scm ("opam->guix-package"): Mock 'get-opam-repository'
again.
master
parent
511dc6877e
commit
358ad74f41
|
@ -71,6 +71,8 @@ url {
|
||||||
(test-begin "opam")
|
(test-begin "opam")
|
||||||
|
|
||||||
(test-assert "opam->guix-package"
|
(test-assert "opam->guix-package"
|
||||||
|
(mock ((guix import opam) get-opam-repository
|
||||||
|
(const test-repo))
|
||||||
(mock ((guix import utils) url-fetch
|
(mock ((guix import utils) url-fetch
|
||||||
(lambda (url file-name)
|
(lambda (url file-name)
|
||||||
(match url
|
(match url
|
||||||
|
@ -114,7 +116,7 @@ url {
|
||||||
test-source-hash)
|
test-source-hash)
|
||||||
hash))
|
hash))
|
||||||
(x
|
(x
|
||||||
(pk 'fail x #f)))))
|
(pk 'fail x #f))))))
|
||||||
|
|
||||||
;; Test the opam file parser
|
;; Test the opam file parser
|
||||||
;; We fold over some test cases. Each case is a pair of the string to parse and the
|
;; We fold over some test cases. Each case is a pair of the string to parse and the
|
||||||
|
|
Reference in New Issue