Compare commits

..

4 Commits

Author SHA1 Message Date
aclist
8f1e4ff9d0 chore: drop fixed comment
Some checks failed
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
2026-07-07 16:32:23 +09:00
aclist
92792b0b4f chore: drop extraneous comment 2026-07-07 16:29:10 +09:00
aclist
a7cfd4c346 fix: monkeypatch system env 2026-07-07 16:28:52 +09:00
aclist
fa5f638697 chore: add comment 2026-07-07 12:03:10 +09:00
5 changed files with 3 additions and 9 deletions

View File

@ -3,7 +3,6 @@ import re
from typing import Literal from typing import Literal
api_filter = r"(.*&key=)([^&]*)(.*)" api_filter = r"(.*&key=)([^&]*)(.*)"
# FIXME: handle whitespace after directory name ($HOME root)
home_filter = r"(/home/)([^\s'\/]*)(.*)" home_filter = r"(/home/)([^\s'\/]*)(.*)"
REDACTED = r"\1REDACTED\3" REDACTED = r"\1REDACTED\3"
REDACTION_PATTERNS = [api_filter, home_filter] REDACTION_PATTERNS = [api_filter, home_filter]

View File

@ -288,6 +288,7 @@ class Options(Gtk.Box):
def _on_api_change_failed(self, emitter: "Emitter") -> None: def _on_api_change_failed(self, emitter: "Emitter") -> None:
self.old_entry.set_text(self.old_text) self.old_entry.set_text(self.old_text)
# TODO: use popover
dialog = ExceptionDialog(self.controller, errors.api_validation_error) dialog = ExceptionDialog(self.controller, errors.api_validation_error)
dialog.run() dialog.run()

View File

@ -26,7 +26,7 @@ def state_files():
@pytest.fixture @pytest.fixture
def xdg_paths(): def xdg_paths(monkeypatch):
routes = { routes = {
"XDG_CONFIG_HOME": "", "XDG_CONFIG_HOME": "",
"XDG_STATE_HOME": "", "XDG_STATE_HOME": "",
@ -37,7 +37,7 @@ def xdg_paths():
tmp = tempfile.TemporaryDirectory(delete=False) tmp = tempfile.TemporaryDirectory(delete=False)
routes[route] = tmp.name routes[route] = tmp.name
for k, v in routes.items(): for k, v in routes.items():
os.environ[k] = v monkeypatch.setenv(k, v)
env = get_xdg_paths() env = get_xdg_paths()
return parse_filepaths(env) return parse_filepaths(env)

View File

@ -95,8 +95,3 @@ def test_missing_values(unset_values):
j = convert.rc2json(unset_values) j = convert.rc2json(unset_values)
j = json.loads(j) j = json.loads(j)
assert j.keys() == config_boilerplate.keys() assert j.keys() == config_boilerplate.keys()
# TODO: test that when a config file is created from scratch, it contains all values

View File

@ -20,7 +20,6 @@ def test_steam(config):
key = config["steam_api"] key = config["steam_api"]
assert probe.test_steam_api(key) assert probe.test_steam_api(key)
def test_bm(config): def test_bm(config):
key = config["bm_api"] key = config["bm_api"]
assert probe.test_bm_api(key) assert probe.test_bm_api(key)