unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Robert Vollmert <rob@vllmrt.net>
To: 35929@debbugs.gnu.org
Cc: Robert Vollmert <rob@vllmrt.net>
Subject: [bug#35929] [PATCH 2/2] tests: hackage: Don't mock hackage-fetch.
Date: Fri, 31 May 2019 21:36:29 +0200	[thread overview]
Message-ID: <20190531193629.57733-2-rob@vllmrt.net> (raw)
In-Reply-To: <20190531193629.57733-1-rob@vllmrt.net>

* 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	other threads:[~2019-05-31 19:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-27 19:45 [bug#35929] [PATCH] tests: hackage: avoid mock, and extract test data Robert Vollmert
2019-05-29 21:16 ` Ludovic Courtès
2019-05-29 21:25   ` Robert Vollmert
2019-05-30 11:42   ` Robert Vollmert
2019-05-31 17:57     ` Ludovic Courtès
2019-05-30 11:46 ` [bug#35929] [PATCH 1/2] tests: hackage: Factor out package pattern Robert Vollmert
2019-05-30 11:46   ` [bug#35929] [PATCH 2/2] tests: hackage: Don't mock hackage-fetch Robert Vollmert
2019-05-31 19:36 ` [bug#35929] [PATCH 1/2] tests: hackage: Factor out package pattern Robert Vollmert
2019-05-31 19:36   ` Robert Vollmert [this message]
2019-05-31 21:22 ` [bug#35929] [PATCH 1/3] " Robert Vollmert
2019-05-31 21:22   ` [bug#35929] [PATCH 2/3] tests: hackage: Don't mock hackage-fetch Robert Vollmert
2019-05-31 21:22   ` [bug#35929] [PATCH 3/3] tests: Indent hackage tests Robert Vollmert
2019-05-31 21:23   ` [bug#35929] [PATCH 1/3] tests: hackage: Factor out package pattern Robert Vollmert
2019-06-01 12:53     ` bug#35929: " Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190531193629.57733-2-rob@vllmrt.net \
    --to=rob@vllmrt.net \
    --cc=35929@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).