tests: hackage: Don't mock hackage-fetch.
authorRobert Vollmert <rob@vllmrt.net>
Fri, 31 May 2019 21:22:42 +0000 (23:22 +0200)
committerLudovic Courtès <ludo@gnu.org>
Sat, 1 Jun 2019 13:26:30 +0000 (15:26 +0200)
* tests/hackage.scm: Pass a string input port to tests instead of
mocking hackage download.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
tests/hackage.scm

index 41e3b2d..1b48001 100644 (file)
@@ -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))