udiskie: add tests

This commit is contained in:
Lily Foster 2022-08-22 11:01:54 -04:00 committed by Robert Helgesson
parent ee8e99add5
commit 991ff35249
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
6 changed files with 46 additions and 0 deletions

View file

@ -182,6 +182,7 @@ import nmt {
./modules/services/syncthing
./modules/services/trayer
./modules/services/twmn
./modules/services/udiskie
./modules/services/window-managers/bspwm
./modules/services/window-managers/herbstluftwm
./modules/services/window-managers/i3

View file

@ -0,0 +1,15 @@
{
config = {
services.udiskie.enable = true;
test.stubs.udiskie = { };
nmt.script = ''
serviceFile="home-files/.config/systemd/user/udiskie.service"
assertFileRegex "$serviceFile" 'After=tray\.target'
assertFileRegex "$serviceFile" 'Requires=tray\.target'
assertFileContent "home-files/.config/udiskie/config.yml" \
${./basic.yml}
'';
};
}

View file

@ -0,0 +1,4 @@
program_options:
automount: true
notify: true
tray: auto

View file

@ -0,0 +1,4 @@
{
udiskie-basic = ./basic.nix;
udiskie-no-tray = ./no-tray.nix;
}

View file

@ -0,0 +1,18 @@
{
config = {
services.udiskie = {
enable = true;
tray = "never";
};
test.stubs.udiskie = { };
nmt.script = ''
serviceFile="home-files/.config/systemd/user/udiskie.service"
assertFileNotRegex "$serviceFile" 'After=tray\.target'
assertFileNotRegex "$serviceFile" 'Requires=tray\.target'
assertFileContent "home-files/.config/udiskie/config.yml" \
${./no-tray.yml}
'';
};
}

View file

@ -0,0 +1,4 @@
program_options:
automount: true
notify: true
tray: false