From 20e9a900998414879ad88cfe49f6ddd09d338fd1 Mon Sep 17 00:00:00 2001 From: Mikilio Date: Tue, 4 Jun 2024 19:16:38 +0200 Subject: [PATCH] chore: add test --- tests/modules/programs/todoman/config.nix | 21 +++++++++++++++++++ tests/modules/programs/todoman/default.nix | 1 + .../programs/todoman/todoman-config-expected | 3 +++ 3 files changed, 25 insertions(+) create mode 100644 tests/modules/programs/todoman/config.nix create mode 100644 tests/modules/programs/todoman/default.nix create mode 100644 tests/modules/programs/todoman/todoman-config-expected diff --git a/tests/modules/programs/todoman/config.nix b/tests/modules/programs/todoman/config.nix new file mode 100644 index 000000000..7323b7a43 --- /dev/null +++ b/tests/modules/programs/todoman/config.nix @@ -0,0 +1,21 @@ +{ + programs.todoman = { + enable = true; + glob = "*/*"; + extraConfig = '' + date_format = "%d.%m.%Y" + default_list = "test" + ''; + }; + + accounts.calendar.basePath = "base/path/calendar"; + + test.stubs = { todoman = { }; }; + + nmt.script = '' + configFile=home-files/.config/todoman/config.py + assertFileExists $configFile + assertFileContent $configFile ${./todoman-config-expected} + ''; +} + diff --git a/tests/modules/programs/todoman/default.nix b/tests/modules/programs/todoman/default.nix new file mode 100644 index 000000000..d429f9230 --- /dev/null +++ b/tests/modules/programs/todoman/default.nix @@ -0,0 +1 @@ +{ todoman-config = ./config.nix; } diff --git a/tests/modules/programs/todoman/todoman-config-expected b/tests/modules/programs/todoman/todoman-config-expected new file mode 100644 index 000000000..00da13e1a --- /dev/null +++ b/tests/modules/programs/todoman/todoman-config-expected @@ -0,0 +1,3 @@ +path = "/home/hm-user/base/path/calendar/*/*" +date_format = "%d.%m.%Y" +default_list = "test"