mirror of
https://github.com/nix-community/home-manager
synced 2024-11-26 21:19:45 +01:00
udiskie: add tests
This commit is contained in:
parent
ee8e99add5
commit
991ff35249
6 changed files with 46 additions and 0 deletions
|
@ -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
|
||||
|
|
15
tests/modules/services/udiskie/basic.nix
Normal file
15
tests/modules/services/udiskie/basic.nix
Normal 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}
|
||||
'';
|
||||
};
|
||||
}
|
4
tests/modules/services/udiskie/basic.yml
Normal file
4
tests/modules/services/udiskie/basic.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
program_options:
|
||||
automount: true
|
||||
notify: true
|
||||
tray: auto
|
4
tests/modules/services/udiskie/default.nix
Normal file
4
tests/modules/services/udiskie/default.nix
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
udiskie-basic = ./basic.nix;
|
||||
udiskie-no-tray = ./no-tray.nix;
|
||||
}
|
18
tests/modules/services/udiskie/no-tray.nix
Normal file
18
tests/modules/services/udiskie/no-tray.nix
Normal 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}
|
||||
'';
|
||||
};
|
||||
}
|
4
tests/modules/services/udiskie/no-tray.yml
Normal file
4
tests/modules/services/udiskie/no-tray.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
program_options:
|
||||
automount: true
|
||||
notify: true
|
||||
tray: false
|
Loading…
Reference in a new issue