mirror of
https://github.com/aclist/dztui.git
synced 2026-11-23 18:09:30 +01:00
Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1a4bc40cf6 | ||
|
|
4487833d99 | ||
|
|
e528580350 | ||
|
|
e5d94a8c52 | ||
|
|
29c2765732 | ||
|
|
0d946de881 | ||
|
|
abf68b0962 | ||
|
|
47168cd0bf | ||
|
|
db2ddca9a5 | ||
|
|
5c81f228b0 |
No files matched your search
@@ -29,3 +29,8 @@ sphinx-build -M html source build -a
|
||||
2. Set up the build target: `rustup target add x86_64-unknown-linux-musl`
|
||||
3. Run `python3 scripts/release.py`
|
||||
4. Generate a release and tag against the resulting tarfile generated in `dist`
|
||||
|
||||
### Running tests
|
||||
|
||||
Some tests are environment specific and require real configuration files.
|
||||
For a generally environment-agnostic test suite, invoke `pytest -m "not realconfig, not flatpak"`
|
||||
@@ -2,7 +2,7 @@ import binascii
|
||||
import ctypes
|
||||
import logging
|
||||
import shutil
|
||||
import vdf # type: ignore
|
||||
import vdf # type: ignore[import-untyped]
|
||||
|
||||
from dataclasses import dataclass
|
||||
from importlib import resources
|
||||
@@ -114,6 +114,7 @@ class Shortcuts:
|
||||
make_parents(dest)
|
||||
b = images.joinpath(img).with_suffix(".png").read_bytes()
|
||||
dest.write_bytes(b)
|
||||
logger.debug(f"Wrote grid image to '{dest}'")
|
||||
|
||||
# NOTE: legacy Big Picture header
|
||||
b = images.joinpath("_hero.png").read_bytes()
|
||||
@@ -127,6 +128,7 @@ class Shortcuts:
|
||||
except Exception:
|
||||
n = 0
|
||||
self.shortcuts["shortcuts"][str(n)] = entry
|
||||
logger.debug(f"Added shortcut at index {n}")
|
||||
|
||||
@classmethod
|
||||
def _create_entry(cls, meta: ShortcutMetadata) -> dict[str, Any]:
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ import psutil
|
||||
import re
|
||||
import requests
|
||||
import subprocess
|
||||
import vdf # type: ignore
|
||||
import vdf # type: ignore[import-untyped]
|
||||
|
||||
from pathlib import Path
|
||||
from requests.exceptions import HTTPError
|
||||
|
||||
@@ -66,7 +66,7 @@ def copy_state_files(state_path: Path) -> None:
|
||||
".month",
|
||||
]
|
||||
if state_path == legacy:
|
||||
# TODO: log this
|
||||
logger.debug(f"Legacy state path '{legacy}' is identical to current")
|
||||
return
|
||||
for file in legacy.iterdir():
|
||||
if file.name in to_copy:
|
||||
|
||||
@@ -13,7 +13,6 @@ from dzgui.api.probe import test_steam_api
|
||||
from dzgui.const.enum import Preferences
|
||||
from dzgui.managers.threading import call_on_thread, StoredFunc, ThreadingManager
|
||||
from dzgui.views.dialogs.generic import ExceptionDialog
|
||||
from dzgui.strings import dialogs
|
||||
from dzgui.util._json import read_json, write_json
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
||||
@@ -147,7 +147,7 @@ class ConnectionManager:
|
||||
self.missing_mods = missing_mods
|
||||
self.remote_mod_ids = [mod[1] for mod in remote_mods]
|
||||
except Exception as e:
|
||||
logger.warning(e)
|
||||
logger.critical(e)
|
||||
self.thread_man.set_cleanup_func(failure_func, destroy_first=True)
|
||||
return
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ class UpdateManager:
|
||||
except Exception as e:
|
||||
func = StoredFunc(self._on_update_failure, str(e))
|
||||
self.thread_man.set_cleanup_func(func, destroy_first=True)
|
||||
logger.warning(e)
|
||||
logger.critical(e)
|
||||
|
||||
def _on_update_success(self) -> None:
|
||||
msg = dialogs.update_success
|
||||
|
||||
@@ -205,7 +205,7 @@ class ServerModelManager:
|
||||
res = Servers.query_by_ip(addr)
|
||||
self._parse_single_record(res)
|
||||
except Exception as e:
|
||||
logger.warning(e)
|
||||
logger.critical(e)
|
||||
self.thread_man.set_cleanup_func(
|
||||
StoredFunc(self._cleanup_on_failure), destroy_first=True
|
||||
)
|
||||
@@ -219,7 +219,7 @@ class ServerModelManager:
|
||||
res = Servers.query_by_record(record)
|
||||
self._parse_single_record(res)
|
||||
except Exception as e:
|
||||
logger.warning(e)
|
||||
logger.critical(e)
|
||||
self.thread_man.set_cleanup_func(
|
||||
StoredFunc(self._cleanup_on_failure), destroy_first=True
|
||||
)
|
||||
@@ -232,7 +232,7 @@ class ServerModelManager:
|
||||
res = Servers.query_by_record(record)
|
||||
self._parse_single_record(res, delete=True)
|
||||
except Exception as e:
|
||||
logger.warning(e)
|
||||
logger.critical(e)
|
||||
self.thread_man.set_cleanup_func(
|
||||
StoredFunc(self._cleanup_on_failure), destroy_first=True
|
||||
)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import pytest
|
||||
import vdf
|
||||
import vdf # type: ignore[import-untyped]
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
@@ -7,11 +7,13 @@ from dzgui.api.mods import get_local_mod_ids
|
||||
from dzgui.util.dirs import make_parents
|
||||
from tests.fixtures import fixture_path
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def libraryfolders() -> Path:
|
||||
return fixture_path("api/steamapps/libraryfolders.vdf")
|
||||
|
||||
def test_missing_mod_dir(tmp_path, libraryfolders: Path) -> None:
|
||||
|
||||
def test_missing_mod_dir(tmp_path: Path, libraryfolders: Path) -> None:
|
||||
"""
|
||||
Updates fixture file key with tmp path value serializes to file,
|
||||
then tests for missing mod directory returning an empty list
|
||||
|
||||
Reference in new issue
Block a user