From 596c3a445e9678ea5c757c661bb4710abc56f00e Mon Sep 17 00:00:00 2001 From: Reimar Bauer Date: Sat, 17 Jan 2026 09:45:20 +0100 Subject: [PATCH] regex for filepath changed --- mslib/support/qt_json_view/datatypes.py | 4 +++- tests/_test_msui/test_msui.py | 3 ++- tests/fixtures.py | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mslib/support/qt_json_view/datatypes.py b/mslib/support/qt_json_view/datatypes.py index fbc216281..eed604cdb 100644 --- a/mslib/support/qt_json_view/datatypes.py +++ b/mslib/support/qt_json_view/datatypes.py @@ -366,7 +366,9 @@ def actions(self, index): class FilepathType(DataType): """Files and paths can be opened.""" - REGEX = re.compile(r'(\/.*)|([A-Z]:\\.*)') + # REGEX = re.compile(r'(\/.*)|([A-Z]:\\.*)') + # (mss) + REGEX = re.compile(r'(~\/.*)|(\/.*)|([A-Z]:\\.*)') def matches(self, data): # (mss) diff --git a/tests/_test_msui/test_msui.py b/tests/_test_msui/test_msui.py index 2869ca134..c15050236 100644 --- a/tests/_test_msui/test_msui.py +++ b/tests/_test_msui/test_msui.py @@ -51,8 +51,9 @@ def test_main(): def test_keep_config_file(qtbot): - # in conftest we set always the mss_dir in the config file + # in fixtures we set the mss_dir in the config file mss_dir = config_loader(dataset="mss_dir") + assert "~" not in mss_dir _config = MSUI_CONFIG_FILE_PATH.read_text() assert _config == f'''{{ "mss_dir": "{mss_dir}" diff --git a/tests/fixtures.py b/tests/fixtures.py index 320a4a6c9..7521d8acf 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -23,6 +23,8 @@ See the License for the specific language governing permissions and limitations under the License. """ +import os + import pytest import mock import multiprocessing @@ -72,6 +74,7 @@ def close_remaining_widgets(): @pytest.fixture def msui_configs(tmp_path): + os.environ['MSUI_SETTINGS'] = os.path.join(tmp_path, "msui_settings.json") modify_config_file({"mss_dir": str(tmp_path)})