aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-05-16 00:25:45 +0100
committerChristopher Baines <mail@cbaines.net>2019-05-16 00:25:45 +0100
commit26cdf5568f6ab9efb5177ab2e87d6bccd026e122 (patch)
treefe6ed5ffca8efedbb77b03c4b1d015ada8c26948
parente6effe7556490b2f4a3ec69b784125129ed93aab (diff)
downloaddata-service-26cdf5568f6ab9efb5177ab2e87d6bccd026e122.tar
data-service-26cdf5568f6ab9efb5177ab2e87d6bccd026e122.tar.gz
Fix the package-metadata tests
-rw-r--r--tests/model-package-metadata.scm22
1 files changed, 19 insertions, 3 deletions
diff --git a/tests/model-package-metadata.scm b/tests/model-package-metadata.scm
index 5c0092d..f9eccec 100644
--- a/tests/model-package-metadata.scm
+++ b/tests/model-package-metadata.scm
@@ -2,7 +2,9 @@
#:use-module (ice-9 match)
#:use-module (srfi srfi-64)
#:use-module (guix utils)
+ #:use-module (guix tests)
#:use-module (tests mock-inferior)
+ #:use-module (guix-data-service model license-set)
#:use-module (guix-data-service database))
(test-begin "test-model-package-metadata")
@@ -16,6 +18,17 @@
(home-page "https://example.com")
(location (location "file.scm" 5 0))))
+(define (test-license-set-ids conn)
+ (mock
+ ((guix-data-service model license)
+ inferior-packages->license-data
+ (lambda (inf packages)
+ '((("License 1"
+ "https://gnu.org/licenses/test-1.html"
+ "https://example.com/why-license-1")))))
+
+ (inferior-packages->license-set-ids conn #f #f)))
+
(with-mock-inferior-packages
(lambda ()
(use-modules (guix-data-service model package)
@@ -32,7 +45,8 @@
(match
(inferior-packages->package-metadata-ids
conn
- (list mock-inferior-package-foo))
+ (list mock-inferior-package-foo)
+ (test-license-set-ids conn))
((x) (string? x))))
#:always-rollback? #t))
@@ -42,10 +56,12 @@
(test-equal "inferior-packages->package-metadata-ids"
(inferior-packages->package-metadata-ids
conn
- (list mock-inferior-package-foo))
+ (list mock-inferior-package-foo)
+ (test-license-set-ids conn))
(inferior-packages->package-metadata-ids
conn
- (list mock-inferior-package-foo)))
+ (list mock-inferior-package-foo)
+ (test-license-set-ids conn)))
#:always-rollback? #t))))))
(test-end)