aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)