[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
07/11: import: texlive: Avoid uses of '@@' in tests.
From: |
guix-commits |
Subject: |
07/11: import: texlive: Avoid uses of '@@' in tests. |
Date: |
Fri, 17 Jan 2020 08:25:47 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit 6f918d69b4824226c877c0ca6385360a1dd38bbd
Author: Ludovic Courtès <address@hidden>
AuthorDate: Fri Jan 17 13:50:53 2020 +0100
import: texlive: Avoid uses of '@@' in tests.
* guix/import/texlive.scm (fetch-sxml, sxml->package): Export.
* tests/texlive.scm <top level>: Call '%http-server-port'.
("fetch-sxml: returns SXML for valid XML"): Use 'with-http-server' and
set 'current-http-proxy' instead of using 'mock'.
("sxml->package"): Remove use of '@@'.
---
guix/import/texlive.scm | 5 ++++-
tests/texlive.scm | 14 +++++++++-----
2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/guix/import/texlive.scm b/guix/import/texlive.scm
index d528aac..a84683e 100644
--- a/guix/import/texlive.scm
+++ b/guix/import/texlive.scm
@@ -38,7 +38,10 @@
#:use-module (guix packages)
#:use-module (gnu packages)
#:use-module (guix build-system texlive)
- #:export (texlive->guix-package))
+ #:export (texlive->guix-package
+
+ fetch-sxml
+ sxml->package))
;;; Commentary:
;;;
diff --git a/tests/texlive.scm b/tests/texlive.scm
index e28eda1..f7e5515 100644
--- a/tests/texlive.scm
+++ b/tests/texlive.scm
@@ -20,10 +20,12 @@
#:use-module (gnu packages tex)
#:use-module (guix import texlive)
#:use-module (guix tests)
+ #:use-module (guix tests http)
#:use-module (guix build utils)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-64)
#:use-module (srfi srfi-26)
+ #:use-module (web client)
#:use-module (ice-9 match))
(test-begin "texlive")
@@ -67,12 +69,14 @@
(keyval (@ (value "tests") (key "topic")))
"\n null\n")))
+;; Avoid collisions with other tests.
+(%http-server-port 10200)
+
(test-equal "fetch-sxml: returns SXML for valid XML"
sxml
- (mock ((guix http-client) http-fetch
- (lambda (url)
- xml))
- ((@@ (guix import texlive) fetch-sxml) "foo")))
+ (with-http-server `((200 ,xml))
+ (parameterize ((current-http-proxy (%local-url)))
+ (fetch-sxml "foo"))))
;; TODO:
(test-assert "sxml->package"
@@ -86,7 +90,7 @@
(with-output-to-file (string-append directory "/foo")
(lambda ()
(display "source")))))
- (let ((result ((@@ (guix import texlive) sxml->package) sxml)))
+ (let ((result (sxml->package sxml)))
(match result
(('package
('name "texlive-latex-foo")
- branch master updated (df18ea6 -> 05f8a14), guix-commits, 2020/01/17
- 01/11: packages: Prevent inlining of 'find-best-packages-by-name'., guix-commits, 2020/01/17
- 02/11: lint: derivation: Adjust exception handling for Guile 3., guix-commits, 2020/01/17
- 03/11: lint: vulnerabilities: Avoid 'mock' in test., guix-commits, 2020/01/17
- 04/11: doc: cookbook: Avoid URL reference to the manual., guix-commits, 2020/01/17
- 05/11: doc: Replace some invalid uses of @var with @code., guix-commits, 2020/01/17
- 06/11: import: opam: Avoid uses of '@@' in tests., guix-commits, 2020/01/17
- 09/11: gnu: Add imv., guix-commits, 2020/01/17
- 11/11: git-authenticate: Add new key for atheia., guix-commits, 2020/01/17
- 10/11: gnu: imv: Record the absolute file name of 'imv-x11' and 'imv-wayland'., guix-commits, 2020/01/17
- 07/11: import: texlive: Avoid uses of '@@' in tests.,
guix-commits <=
- 08/11: gnu: Add corsix-th., guix-commits, 2020/01/17