nixos/tests/home-assistant: test loading lovelace modules

This commit is contained in:
Martin Weinelt 2022-01-31 02:32:39 +01:00
parent f30192ae6f
commit f2bd10bb1e
No known key found for this signature in database
GPG key ID: 87C1E9888F856759

View file

@ -43,6 +43,11 @@ in {
psycopg2
];
# test loading lovelace modules
customLovelaceModules = with pkgs.home-assistant-custom-lovelace-modules; [
mini-graph-card
];
config = {
homeassistant = {
name = "Home";
@ -161,6 +166,10 @@ in {
hass.wait_for_open_port(8123)
hass.succeed("curl --fail http://localhost:8123/lovelace")
with subtest("Check that lovelace modules are referenced and fetchable"):
hass.succeed("grep -q 'mini-graph-card-bundle.js' '${configDir}/ui-lovelace.yaml'")
hass.succeed("curl --fail http://localhost:8123/local/nixos-lovelace-modules/mini-graph-card-bundle.js")
with subtest("Check that optional dependencies are in the PYTHONPATH"):
env = get_unit_property("Environment")
python_path = env.split("PYTHONPATH=")[1].split()[0]