From 4893d1b4d4ba30f590d11b9f32d2f43c0bbbb7b6 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sun, 26 Jan 2020 11:25:12 +0100 Subject: [PATCH] notmuch: add basic test case --- tests/default.nix | 1 + .../notmuch/basic-config-expected.conf | 19 +++++++++++ .../modules/programs/notmuch/basic-config.nix | 33 +++++++++++++++++++ tests/modules/programs/notmuch/default.nix | 3 ++ 4 files changed, 56 insertions(+) create mode 100644 tests/modules/programs/notmuch/basic-config-expected.conf create mode 100644 tests/modules/programs/notmuch/basic-config.nix create mode 100644 tests/modules/programs/notmuch/default.nix diff --git a/tests/default.nix b/tests/default.nix index ab5e4a005..2c9fd77fe 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -46,6 +46,7 @@ import nmt { // import ./modules/programs/git // import ./modules/programs/gpg // import ./modules/programs/newsboat + // import ./modules/programs/notmuch // import ./modules/programs/readline // import ./modules/programs/ssh // import ./modules/programs/tmux diff --git a/tests/modules/programs/notmuch/basic-config-expected.conf b/tests/modules/programs/notmuch/basic-config-expected.conf new file mode 100644 index 000000000..67c8f141f --- /dev/null +++ b/tests/modules/programs/notmuch/basic-config-expected.conf @@ -0,0 +1,19 @@ +# Generated by Home Manager. + +[database] +path=/home/hm-user/Mail + +[maildir] +synchronize_flags=true + +[new] +ignore= +tags=unread;inbox + +[search] +exclude_tags=deleted;spam + +[user] +name=H. M. Test +other_email=;hm@example.org; +primary_email=hm@example.com diff --git a/tests/modules/programs/notmuch/basic-config.nix b/tests/modules/programs/notmuch/basic-config.nix new file mode 100644 index 000000000..a070bb6f4 --- /dev/null +++ b/tests/modules/programs/notmuch/basic-config.nix @@ -0,0 +1,33 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + imports = [ ../../accounts/email-test-accounts.nix ]; + + config = { + home.username = "hm-user"; + home.homeDirectory = "/home/hm-user"; + + programs.notmuch = { + enable = true; + }; + + accounts.email.accounts = { + "hm@example.com" = { + notmuch.enable = true; + primary = true; + }; + + hm-account.notmuch = { + enable = true; + }; + }; + + nmt.script = '' + assertFileExists home-files/.config/notmuch/notmuchrc + assertFileContent home-files/.config/notmuch/notmuchrc \ + ${./basic-config-expected.conf} + ''; + }; +} diff --git a/tests/modules/programs/notmuch/default.nix b/tests/modules/programs/notmuch/default.nix new file mode 100644 index 000000000..8747868a6 --- /dev/null +++ b/tests/modules/programs/notmuch/default.nix @@ -0,0 +1,3 @@ +{ + notmuch-basic-config = ./basic-config.nix; +}