calamares/src/modules/displaymanager/tests/test-dm-greetd.py
Adriaan de Groot 16a029abd2 [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
2021-11-15 13:37:23 +01:00

22 lines
722 B
Python

# Calamares Boilerplate
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
# Specific DM test
d = main.DMgreetd("/tmp")
d.set_autologin("d", True, default_desktop_environment)
# .. and again (this time checks load/save)
d.set_autologin("d", True, default_desktop_environment)
d.set_autologin("d", True, default_desktop_environment)