hyprsunset: Add tests for transitons option
Adds tests to ensure that the services are still created correctly and the correct deprecation warnings are shown Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
parent
7c01358ff6
commit
fa184c5460
2 changed files with 59 additions and 0 deletions
|
|
@ -3,4 +3,5 @@
|
|||
lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
|
||||
hyprsunset-basic-configuration = ./basic-configuration.nix;
|
||||
hyprsunset-no-configuration = ./no-configuration.nix;
|
||||
hyprsunset-transitions-deprecated = ./transitions-deprecated.nix;
|
||||
}
|
||||
|
|
|
|||
58
tests/modules/services/hyprsunset/transitions-deprecated.nix
Normal file
58
tests/modules/services/hyprsunset/transitions-deprecated.nix
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
{
|
||||
services.hyprsunset = {
|
||||
enable = true;
|
||||
extraArgs = [ "--identity" ];
|
||||
|
||||
transitions = {
|
||||
sunrise = {
|
||||
calendar = "*-*-* 06:30:00";
|
||||
requests = [
|
||||
[ "temperature 6500" ]
|
||||
[ "identity" ]
|
||||
];
|
||||
};
|
||||
|
||||
sunset = {
|
||||
calendar = "*-*-* 19:30:00";
|
||||
requests = [ [ "temperature 3500" ] ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
# Check that the main service exists
|
||||
mainService=home-files/.config/systemd/user/hyprsunset.service
|
||||
assertFileExists $mainService
|
||||
|
||||
# Check that the transition services exist
|
||||
sunriseService=home-files/.config/systemd/user/hyprsunset-sunrise.service
|
||||
sunsetService=home-files/.config/systemd/user/hyprsunset-sunset.service
|
||||
assertFileExists $sunriseService
|
||||
assertFileExists $sunsetService
|
||||
|
||||
# Check that the timers exist
|
||||
sunriseTimer=home-files/.config/systemd/user/hyprsunset-sunrise.timer
|
||||
sunsetTimer=home-files/.config/systemd/user/hyprsunset-sunset.timer
|
||||
assertFileExists $sunriseTimer
|
||||
assertFileExists $sunsetTimer
|
||||
|
||||
# Verify timer configurations
|
||||
assertFileContains $sunriseTimer "OnCalendar=*-*-* 06:30:00"
|
||||
assertFileContains $sunsetTimer "OnCalendar=*-*-* 19:30:00"
|
||||
|
||||
# Verify service configurations
|
||||
assertFileContains $sunriseService "ExecStart=@hyprland@/bin/hyprctl hyprsunset 'temperature 6500' && @hyprland@/bin/hyprctl hyprsunset identity"
|
||||
assertFileContains $sunsetService "ExecStart=@hyprland@/bin/hyprctl hyprsunset 'temperature 3500'"
|
||||
|
||||
# Check that the config file does not exist
|
||||
config=home-files/.config/hypr/hyprsunset.conf
|
||||
assertPathNotExists $config
|
||||
'';
|
||||
|
||||
test.asserts.warnings.expected = [
|
||||
''
|
||||
Using services.hyprsunset.transitions is deprecated. Please use
|
||||
services.hyprsunset.settings instead.
|
||||
''
|
||||
];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue