guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Robert Vollmert
Subject: [bug#35929] [PATCH 2/2] tests: hackage: Don't mock hackage-fetch.
Date: Fri, 31 May 2019 21:36:29 +0200

* 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 --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
-- 
2.20.1 (Apple Git-117)






reply via email to

[Prev in Thread] Current Thread [Next in Thread]