diff mbox series

[bug#35929,2/3] tests: hackage: Don't mock hackage-fetch.

Message ID 20190531212243.58302-2-rob@vllmrt.net
State Accepted
Headers show
Series [bug#35929,1/3] tests: hackage: Factor out package pattern. | expand

Checks

Context Check Description
cbaines/applying patch fail Apply failed
cbaines/applying patch fail Apply failed

Commit Message

Robert Vollmert May 31, 2019, 9:22 p.m. UTC
* tests/hackage.scm: Pass a string input port to tests instead of
mocking hackage download.
---
 tests/hackage.scm | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/tests/hackage.scm b/tests/hackage.scm
index 41e3b2dcd3..1b4800164e 100644
--- a/tests/hackage.scm
+++ b/tests/hackage.scm
@@ -186,12 +186,8 @@  library
     ('license 'bsd-3)))
 
 (define* (eval-test-with-cabal test-cabal matcher #:key (cabal-environment '()))
-  (mock
-   ((guix import hackage) hackage-fetch
-    (lambda (name-version)
-      (call-with-input-string test-cabal
-        read-cabal)))
-   (matcher (hackage->guix-package "foo" #:cabal-environment cabal-environment))))
+  (define port (open-input-string test-cabal))
+  (matcher (hackage->guix-package "foo" #:port port #:cabal-environment cabal-environment)))
 
 (test-assert "hackage->guix-package test 1"
   (eval-test-with-cabal test-cabal-1 match-ghc-foo))