Added nested_delete and config_delete
This commit is contained in:
@@ -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()
|
||||
|
Reference in New Issue
Block a user