diff mbox series

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

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

Checks

Context Check Description
cbaines/applying patch fail Apply failed

Commit Message

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

Patch

diff --git a/tests/hackage.scm b/tests/hackage.scm
index c73a28c1f5..ee9cd6bc2d 100644
--- a/tests/hackage.scm
+++ b/tests/hackage.scm
@@ -158,14 +158,10 @@  library
 (define-syntax-rule (make-cabal-import-test pattern)
   (lambda*
       (test-cabal #:key (cabal-environment '()))
-    (mock
-     ((guix import hackage) hackage-fetch
-      (lambda (name-version)
-        (call-with-input-string test-cabal
-          read-cabal)))
-     (match (hackage->guix-package "foo" #:cabal-environment cabal-environment)
-       (pattern #t)
-       (x       (pk 'fail x #f))))))
+    (define port (open-input-string test-cabal))
+    (match (hackage->guix-package "foo" #:port port #:cabal-environment cabal-environment)
+      (pattern #t)
+      (x       (pk 'fail x #f)))))
 
 (define test-cabal-ghc-foo
   (make-cabal-import-test