Migrate from Poetry and pyenv to uv
This commit is contained in:
+16
-11
@@ -1,8 +1,13 @@
|
||||
import pytest
|
||||
import json
|
||||
|
||||
import pytest
|
||||
|
||||
from src.core.config import (
|
||||
load_global_config, save_global_config, DEFAULT_GLOBAL_CONFIG,
|
||||
load_config, save_config # Legacy functions
|
||||
DEFAULT_GLOBAL_CONFIG,
|
||||
load_config, # Legacy functions
|
||||
load_global_config,
|
||||
save_config,
|
||||
save_global_config,
|
||||
)
|
||||
|
||||
|
||||
@@ -14,7 +19,8 @@ class TestGlobalConfig:
|
||||
"""Fixture pro dočasný globální config soubor"""
|
||||
config_path = tmp_path / "config.json"
|
||||
import src.core.config as config_module
|
||||
monkeypatch.setattr(config_module, 'GLOBAL_CONFIG_FILE', config_path)
|
||||
|
||||
monkeypatch.setattr(config_module, "GLOBAL_CONFIG_FILE", config_path)
|
||||
return config_path
|
||||
|
||||
def test_default_global_config_structure(self):
|
||||
@@ -136,7 +142,8 @@ class TestLegacyFunctions:
|
||||
"""Fixture pro dočasný globální config soubor"""
|
||||
config_path = tmp_path / "config.json"
|
||||
import src.core.config as config_module
|
||||
monkeypatch.setattr(config_module, 'GLOBAL_CONFIG_FILE', config_path)
|
||||
|
||||
monkeypatch.setattr(config_module, "GLOBAL_CONFIG_FILE", config_path)
|
||||
return config_path
|
||||
|
||||
def test_load_config_legacy(self, temp_global_config):
|
||||
@@ -166,14 +173,15 @@ class TestConfigEdgeCases:
|
||||
"""Fixture pro dočasný globální config soubor"""
|
||||
config_path = tmp_path / "config.json"
|
||||
import src.core.config as config_module
|
||||
monkeypatch.setattr(config_module, 'GLOBAL_CONFIG_FILE', config_path)
|
||||
|
||||
monkeypatch.setattr(config_module, "GLOBAL_CONFIG_FILE", config_path)
|
||||
return config_path
|
||||
|
||||
def test_config_path_with_spaces(self, temp_global_config):
|
||||
"""Test s cestou obsahující mezery"""
|
||||
test_config = {
|
||||
**DEFAULT_GLOBAL_CONFIG,
|
||||
"last_folder": "/path/with spaces/in name"
|
||||
"last_folder": "/path/with spaces/in name",
|
||||
}
|
||||
|
||||
save_global_config(test_config)
|
||||
@@ -215,10 +223,7 @@ class TestConfigEdgeCases:
|
||||
|
||||
def test_config_ensure_ascii_false(self, temp_global_config):
|
||||
"""Test že ensure_ascii=False funguje správně"""
|
||||
test_config = {
|
||||
**DEFAULT_GLOBAL_CONFIG,
|
||||
"last_folder": "/cesta/čeština"
|
||||
}
|
||||
test_config = {**DEFAULT_GLOBAL_CONFIG, "last_folder": "/cesta/čeština"}
|
||||
|
||||
save_global_config(test_config)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user