From 506abddb99e02f824bff7ed7d7f7b37c4dafe0a7 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sun, 18 Dec 2016 09:55:17 +0100 Subject: tests: Mock up http-fetch in import tests. This is a follow-up to commit 63773200d7ac68fcaee6efd9ffe8ea7aa3fafa38. * tests/gem.scm ("gem->guix-package"): Replace mock definition of "url-fetch" with "http-fetch". * tests/pypi.scm ("pypi->guix-package"): Add mock definition of "http-fetch". --- tests/gem.scm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests/gem.scm') diff --git a/tests/gem.scm b/tests/gem.scm index a46c2b1439..669cd8ee60 100644 --- a/tests/gem.scm +++ b/tests/gem.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015 David Thompson +;;; Copyright © 2016 Ricardo Wurmus ;;; ;;; This file is part of GNU Guix. ;;; @@ -45,13 +46,12 @@ (test-assert "gem->guix-package" ;; Replace network resources with sample data. - (mock ((guix import utils) url-fetch - (lambda (url file-name) + (mock ((guix http-client) http-fetch + (lambda (url) (match url ("https://rubygems.org/api/v1/gems/foo.json" - (with-output-to-file file-name - (lambda () - (display test-json)))) + (values (open-input-string test-json) + (string-length test-json))) (_ (error "Unexpected URL: " url))))) (match (gem->guix-package "foo") (('package -- cgit v1.2.3