mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-15 05:21:06 +01:00
tests: rework derivation stubbing
Instead of having to manually stub packages that should not be downloaded we instead automatically stub all packages (except a small list of whitelisted ones). Tests can re-introduce the real package by using the `realPkgs` module argument.
This commit is contained in:
parent
c5c2cbc866
commit
7a3f0b3b8d
480 changed files with 3557 additions and 5511 deletions
|
|
@ -1,59 +1,53 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
config = {
|
||||
programs.ncmpcpp = {
|
||||
enable = true;
|
||||
mpdMusicDir = "/home/user/music";
|
||||
programs.ncmpcpp = {
|
||||
enable = true;
|
||||
mpdMusicDir = "/home/user/music";
|
||||
|
||||
settings = {
|
||||
user_interface = "alternative";
|
||||
display_volume_level = false;
|
||||
playlist_disable_highlight_delay = 0;
|
||||
};
|
||||
|
||||
bindings = [
|
||||
{
|
||||
key = "j";
|
||||
command = "scroll_down";
|
||||
}
|
||||
{
|
||||
key = "k";
|
||||
command = "scroll_up";
|
||||
}
|
||||
{
|
||||
key = "J";
|
||||
command = [ "select_item" "scroll_down" ];
|
||||
}
|
||||
{
|
||||
key = "K";
|
||||
command = [ "select_item" "scroll_up" ];
|
||||
}
|
||||
{
|
||||
key = "x";
|
||||
command = "delete_playlist_items";
|
||||
}
|
||||
{
|
||||
key = "x";
|
||||
command = "delete_browser_items";
|
||||
}
|
||||
{
|
||||
key = "x";
|
||||
command = "delete_stored_playlist";
|
||||
}
|
||||
];
|
||||
settings = {
|
||||
user_interface = "alternative";
|
||||
display_volume_level = false;
|
||||
playlist_disable_highlight_delay = 0;
|
||||
};
|
||||
|
||||
test.stubs.ncmpcpp = { };
|
||||
|
||||
nmt.script = ''
|
||||
assertFileContent \
|
||||
home-files/.config/ncmpcpp/config \
|
||||
${./ncmpcpp-example-settings-expected-config}
|
||||
|
||||
assertFileContent \
|
||||
home-files/.config/ncmpcpp/bindings \
|
||||
${./ncmpcpp-example-settings-expected-bindings}
|
||||
'';
|
||||
bindings = [
|
||||
{
|
||||
key = "j";
|
||||
command = "scroll_down";
|
||||
}
|
||||
{
|
||||
key = "k";
|
||||
command = "scroll_up";
|
||||
}
|
||||
{
|
||||
key = "J";
|
||||
command = [ "select_item" "scroll_down" ];
|
||||
}
|
||||
{
|
||||
key = "K";
|
||||
command = [ "select_item" "scroll_up" ];
|
||||
}
|
||||
{
|
||||
key = "x";
|
||||
command = "delete_playlist_items";
|
||||
}
|
||||
{
|
||||
key = "x";
|
||||
command = "delete_browser_items";
|
||||
}
|
||||
{
|
||||
key = "x";
|
||||
command = "delete_stored_playlist";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileContent \
|
||||
home-files/.config/ncmpcpp/config \
|
||||
${./ncmpcpp-example-settings-expected-config}
|
||||
|
||||
assertFileContent \
|
||||
home-files/.config/ncmpcpp/bindings \
|
||||
${./ncmpcpp-example-settings-expected-bindings}
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue