1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00

home manager: add test for option subcommand

- added a test to the standalone-basics unit:  the option subcommand queries the `home.username` value and ensures that something sane is returned.

details:

- the option subcommand was broken by upstream changes to the `nixos-option` command.
- hm had no tests for the option subcommand, so the problem was discovered by users.
- output from nixos-option probably starts with 'Value:\n  "alice"', but we're only looking for 'alice' because the output format is not guaranteed.
This commit is contained in:
bruce oberg 2025-10-30 16:31:50 -07:00 committed by Austin Horstman
parent 64c49b1aa5
commit 3c16ac3646

View file

@ -107,6 +107,12 @@
assert expected in actual, \ assert expected in actual, \
f"expected generations to contain {expected}, but found {actual}" f"expected generations to contain {expected}, but found {actual}"
with subtest("Home Manager option"):
actual = succeed_as_alice("home-manager option home.username")
expected = "alice"
assert expected in actual, \
f"expected generations to contain {expected}, but found {actual}"
with subtest("Home Manager uninstallation"): with subtest("Home Manager uninstallation"):
succeed_as_alice("yes | home-manager uninstall -L") succeed_as_alice("yes | home-manager uninstall -L")