mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-12 06:06:53 -05:00
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.
This commit is contained in:
parent
511dc6877e
commit
358ad74f41
1 changed files with 46 additions and 44 deletions
|
@ -71,6 +71,8 @@ (define test-repo
|
|||
(test-begin "opam")
|
||||
|
||||
(test-assert "opam->guix-package"
|
||||
(mock ((guix import opam) get-opam-repository
|
||||
(const test-repo))
|
||||
(mock ((guix import utils) url-fetch
|
||||
(lambda (url file-name)
|
||||
(match url
|
||||
|
@ -114,7 +116,7 @@ (define test-repo
|
|||
test-source-hash)
|
||||
hash))
|
||||
(x
|
||||
(pk 'fail x #f)))))
|
||||
(pk 'fail x #f))))))
|
||||
|
||||
;; Test the opam file parser
|
||||
;; We fold over some test cases. Each case is a pair of the string to parse and the
|
||||
|
|
Loading…
Reference in a new issue