Added nested_delete and config_delete

This commit is contained in:
2024-05-26 15:40:29 +02:00
parent ce691b2eda
commit 7032bef956
10 changed files with 279 additions and 126 deletions

View File

@@ -1,4 +1,7 @@
from json import dumps, loads
from os import makedirs
from pathlib import Path
from uuid import uuid4
import pytest
@@ -7,7 +10,22 @@ from libbot.i18n import BotLocale
@pytest.fixture()
def location_config() -> Path:
return Path("tests/config.json")
makedirs(Path("tests/.tmp"), exist_ok=True)
filename = str(uuid4())
with open(Path("tests/config.json"), "r", encoding="utf-8") as file:
config = loads(file.read())
with open(Path(f"tests/.tmp/{filename}.json"), "w", encoding="utf-8") as file:
file.write(
dumps(
config,
ensure_ascii=False,
indent=4,
)
)
return Path(f"tests/.tmp/{filename}.json")
@pytest.fixture()