From 16a029abd29a3a09da85c13c1563258b78d6346d Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 15 Nov 2021 13:37:23 +0100 Subject: [PATCH] [displaymanager] Adjust tests to match real runtime - the default_desktop_environment isn't a string, but an object; it is unusual for it to be used in set_autologin --- src/modules/displaymanager/tests/test-dm-greetd.py | 14 +++++++++----- src/modules/displaymanager/tests/test-dm-sddm.py | 11 +++++++---- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/modules/displaymanager/tests/test-dm-greetd.py b/src/modules/displaymanager/tests/test-dm-greetd.py index 8988aaa52..6be0e3d47 100644 --- a/src/modules/displaymanager/tests/test-dm-greetd.py +++ b/src/modules/displaymanager/tests/test-dm-greetd.py @@ -2,17 +2,21 @@ import libcalamares libcalamares.globalstorage = libcalamares.GlobalStorage(None) libcalamares.globalstorage.insert("testing", True) + # Module prep-work +from src.modules.displaymanager import main +default_desktop_environment = main.DesktopEnvironment("startplasma-x11", "kde-plasma.desktop") + import os os.makedirs("/tmp/etc/greetd/", exist_ok=True) try: os.remove("/tmp/etc/greetd/config.toml") except FileNotFoundError as e: pass -# Module test -from src.modules.displaymanager import main + +# Specific DM test d = main.DMgreetd("/tmp") -d.set_autologin("d", True, "kde") +d.set_autologin("d", True, default_desktop_environment) # .. and again (this time checks load/save) -d.set_autologin("d", True, "kde") -d.set_autologin("d", True, "kde") +d.set_autologin("d", True, default_desktop_environment) +d.set_autologin("d", True, default_desktop_environment) diff --git a/src/modules/displaymanager/tests/test-dm-sddm.py b/src/modules/displaymanager/tests/test-dm-sddm.py index eb65d95f4..5e4b54b30 100644 --- a/src/modules/displaymanager/tests/test-dm-sddm.py +++ b/src/modules/displaymanager/tests/test-dm-sddm.py @@ -2,11 +2,14 @@ import libcalamares libcalamares.globalstorage = libcalamares.GlobalStorage(None) libcalamares.globalstorage.insert("testing", True) + # Module prep-work -# Module test from src.modules.displaymanager import main +default_desktop_environment = main.DesktopEnvironment("startplasma-x11", "kde-plasma.desktop") + +# Specific DM test d = main.DMsddm("/tmp") -d.set_autologin("d", True, "kde") +d.set_autologin("d", True, default_desktop_environment) # .. and again (this time checks load/save) -d.set_autologin("d", True, "kde") -d.set_autologin("d", True, "kde") +d.set_autologin("d", True, default_desktop_environment) +d.set_autologin("d", True, default_desktop_environment)