projects/guix·blob python-team · refs

55 lines · 2.1 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2021 Maxim Cournoyer <[email protected]>
3;;;
4;;; This file is part of GNU Guix.
5;;;
6;;; GNU Guix is free software; you can redistribute it and/or modify it
7;;; under the terms of the GNU General Public License as published by
8;;; the Free Software Foundation; either version 3 of the License, or (at
9;;; your option) any later version.
10;;;
11;;; GNU Guix is distributed in the hope that it will be useful, but
12;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;;; GNU General Public License for more details.
15;;;
16;;; You should have received a copy of the GNU General Public License
17;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19(define-module (tests services telephony)
20 #:use-module (gnu build jami-service)
21 #:use-module (gnu services telephony)
22 #:use-module (srfi srfi-64))
23
24;;; Tests for the (gnu services telephony) and related modules.
25
26(test-begin "jami-service")
27
28(define jami-account->alist
29 (@@ (gnu services telephony) jami-account->alist))
30
31(define %dummy-jami-account (jami-account
32 (archive "/tmp/dummy.gz")))
33
34(define %dummy-jami-account-2 (jami-account
35 (archive "/tmp/dummy.gz")
36 (rendezvous-point? #t)
37 (peer-discovery? #f)
38 (bootstrap-hostnames '("bootstrap.me"
39 "fallback.another.host"))
40 (name-server-uri "https://my.name.server")))
41
42(test-equal "jami-account->alist, no account detail value set"
43 '()
44 (jami-account->alist %dummy-jami-account))
45
46(test-equal "jami-account->alist, with account detail values"
47 '(("Account.hostname" . "bootstrap.me;fallback.another.host")
48 ("Account.peerDiscovery" . "false")
49 ("Account.rendezVous" . "true")
50 ("RingNS.uri" . "https://my.name.server"))
51 (sort (jami-account->alist %dummy-jami-account-2)
52 (lambda (x y)
53 (string<=? (car x) (car y)))))
54
55(test-end)