mirror of
https://github.com/aclist/dztui.git
synced 2026-10-25 12:12:31 +01:00
chore: add flatpak tests
This commit is contained in:
1 parent
cdec81071d
commit
a9ae5f59b5
3 files changed
+48
-1
No files matched your search
+2
-1
@@ -110,10 +110,11 @@ config-settings-package = { pygobject-stubs = { config = "Gtk3,Gdk3,Soup2" } }
|
|||||||
markers = [
|
markers = [
|
||||||
"apitest: checks remote endpoints",
|
"apitest: checks remote endpoints",
|
||||||
"config: config file keys/values",
|
"config: config file keys/values",
|
||||||
"realconfig: depends on actual generated local config file",
|
"flatpak: depends on local flatpak installation",
|
||||||
"mods: tests mod metadata/link creation",
|
"mods: tests mod metadata/link creation",
|
||||||
"pefile: validate PE files",
|
"pefile: validate PE files",
|
||||||
"post_install: requires a completed installation",
|
"post_install: requires a completed installation",
|
||||||
|
"realconfig: depends on actual generated local config file",
|
||||||
"redact: log redaction mechanisms",
|
"redact: log redaction mechanisms",
|
||||||
"slow: long-running tests",
|
"slow: long-running tests",
|
||||||
"webtest: depends on remote endpoint",
|
"webtest: depends on remote endpoint",
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
import configparser
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
from dzgui.const.constants import FLATPAK_APPID, GTK_APP_ID
|
||||||
|
from dzgui.config.xdg import get_xdg_paths
|
||||||
|
from dzgui.util.flatpak import apply_overrides
|
||||||
|
|
||||||
|
PATHS_KEY = "Context"
|
||||||
|
PATHS_SUBKEY = "filesystems"
|
||||||
|
BUS_KEY = "Session Bus Policy"
|
||||||
|
|
||||||
|
pytestmark = pytest.mark.flatpak
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
def xdg_paths() -> dict[str, str]:
|
||||||
|
return get_xdg_paths()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
def override(xdg_paths) -> None:
|
||||||
|
apply_overrides(xdg_paths)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
def config(xdg_paths) -> configparser.ConfigParser:
|
||||||
|
conf_path = xdg_paths["XDG_DATA_HOME"].parent.joinpath(
|
||||||
|
f"flatpak/overrides/{FLATPAK_APPID}"
|
||||||
|
)
|
||||||
|
config = configparser.ConfigParser()
|
||||||
|
config.read(conf_path)
|
||||||
|
return config
|
||||||
|
|
||||||
|
|
||||||
|
def test_session_bus(override, config) -> None:
|
||||||
|
bus = config[BUS_KEY][GTK_APP_ID]
|
||||||
|
assert bus == "own"
|
||||||
|
|
||||||
|
|
||||||
|
def test_paths(override, xdg_paths, config) -> None:
|
||||||
|
expect = xdg_paths
|
||||||
|
paths = config[PATHS_KEY][PATHS_SUBKEY].split(";")
|
||||||
|
assert all(str(path) in paths for path in expect.values())
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import pytest
|
||||||
import unittest
|
import unittest
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
@@ -9,6 +10,8 @@ from dzgui.const.constants import (
|
|||||||
)
|
)
|
||||||
from dzgui.init import proc
|
from dzgui.init import proc
|
||||||
|
|
||||||
|
pytestmark = pytest.mark.flatpak
|
||||||
|
|
||||||
|
|
||||||
class TestSteamDetection(unittest.TestCase):
|
class TestSteamDetection(unittest.TestCase):
|
||||||
def test_flatpak_detection_with_multiple_running_apps(self):
|
def test_flatpak_detection_with_multiple_running_apps(self):
|
||||||
|
|||||||
Reference in new issue
Block a user