mirror of
https://github.com/nix-community/home-manager
synced 2024-11-26 22:50:39 +00:00
mpdris2: add basic test cases
This commit is contained in:
parent
9042c756fa
commit
2c8489e57a
7 changed files with 76 additions and 0 deletions
|
@ -155,6 +155,7 @@ import nmt {
|
||||||
./modules/services/lieer
|
./modules/services/lieer
|
||||||
./modules/services/mopidy
|
./modules/services/mopidy
|
||||||
./modules/services/mpd
|
./modules/services/mpd
|
||||||
|
./modules/services/mpdris2
|
||||||
./modules/services/pantalaimon
|
./modules/services/pantalaimon
|
||||||
./modules/services/pbgopy
|
./modules/services/pbgopy
|
||||||
./modules/services/picom
|
./modules/services/picom
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
[Bling]
|
||||||
|
mmkeys = True
|
||||||
|
notify = True
|
||||||
|
|
||||||
|
[Connection]
|
||||||
|
host = 127.0.0.1
|
||||||
|
music_dir = /home/hm-user/music
|
||||||
|
port = 6600
|
19
tests/modules/services/mpdris2/basic-configuration.nix
Normal file
19
tests/modules/services/mpdris2/basic-configuration.nix
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
{ ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
services.mpdris2 = {
|
||||||
|
enable = true;
|
||||||
|
notifications = true;
|
||||||
|
multimediaKeys = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
test.stubs.mpdris2 = { };
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
serviceFile=home-files/.config/systemd/user/mpdris2.service
|
||||||
|
assertFileContent "$serviceFile" ${./basic-configuration.service}
|
||||||
|
|
||||||
|
configFile=home-files/.config/mpDris2/mpDris2.conf
|
||||||
|
assertFileContent "$configFile" ${./basic-configuration.config}
|
||||||
|
'';
|
||||||
|
}
|
13
tests/modules/services/mpdris2/basic-configuration.service
Normal file
13
tests/modules/services/mpdris2/basic-configuration.service
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
[Install]
|
||||||
|
WantedBy=default.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
BusName=org.mpris.MediaPlayer2.mpd
|
||||||
|
ExecStart=@mpdris2@/bin/mpDris2
|
||||||
|
Restart=on-failure
|
||||||
|
RestartSec=5s
|
||||||
|
Type=simple
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
After=mpd.service
|
||||||
|
Description=MPRIS 2 support for MPD
|
4
tests/modules/services/mpdris2/default.nix
Normal file
4
tests/modules/services/mpdris2/default.nix
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
mpdris2-basic-configuration = ./basic-configuration.nix;
|
||||||
|
mpdris2-with-password = ./with-password.nix;
|
||||||
|
}
|
9
tests/modules/services/mpdris2/with-password.config
Normal file
9
tests/modules/services/mpdris2/with-password.config
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
[Bling]
|
||||||
|
mmkeys = False
|
||||||
|
notify = False
|
||||||
|
|
||||||
|
[Connection]
|
||||||
|
host = somehost
|
||||||
|
music_dir = /home/hm-user/music
|
||||||
|
password = foo
|
||||||
|
port = 42
|
22
tests/modules/services/mpdris2/with-password.nix
Normal file
22
tests/modules/services/mpdris2/with-password.nix
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
{ ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
services.mpdris2 = {
|
||||||
|
enable = true;
|
||||||
|
mpd = {
|
||||||
|
host = "somehost";
|
||||||
|
port = 42;
|
||||||
|
password = "foo";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
test.stubs.mpdris2 = { };
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
serviceFile=home-files/.config/systemd/user/mpdris2.service
|
||||||
|
assertFileContent "$serviceFile" ${./basic-configuration.service}
|
||||||
|
|
||||||
|
configFile=home-files/.config/mpDris2/mpDris2.conf
|
||||||
|
assertFileContent "$configFile" ${./with-password.config}
|
||||||
|
'';
|
||||||
|
}
|
Loading…
Reference in a new issue