telephony.scm 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
  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. (define-module (tests services telephony)
  19. #:use-module (gnu build jami-service)
  20. #:use-module (gnu services telephony)
  21. #:use-module (srfi srfi-64))
  22. ;;; Tests for the (gnu services telephony) and related modules.
  23. (test-begin "jami-service")
  24. (define jami-account->alist
  25. (@@ (gnu services telephony) jami-account->alist))
  26. (define %dummy-jami-account (jami-account
  27. (archive "/tmp/dummy.gz")))
  28. (define %dummy-jami-account-2 (jami-account
  29. (archive "/tmp/dummy.gz")
  30. (rendezvous-point? #t)
  31. (peer-discovery? #f)
  32. (bootstrap-hostnames '("bootstrap.me"
  33. "fallback.another.host"))
  34. (name-server-uri "https://my.name.server")))
  35. (test-equal "jami-account->alist, no account detail value set"
  36. '()
  37. (jami-account->alist %dummy-jami-account))
  38. (test-equal "jami-account->alist, with account detail values"
  39. '(("Account.hostname" . "bootstrap.me;fallback.another.host")
  40. ("Account.peerDiscovery" . "false")
  41. ("Account.rendezVous" . "true")
  42. ("RingNS.uri" . "https://my.name.server"))
  43. (sort (jami-account->alist %dummy-jami-account-2)
  44. (lambda (x y)
  45. (string<=? (car x) (car y)))))
  46. (test-end)