WIP: Overhaul for 4.0.0

This commit is contained in:
kku
2024-12-18 14:16:37 +01:00
parent 5e479ddc79
commit 95d04308bd
32 changed files with 718 additions and 688 deletions

View File

@@ -7,8 +7,7 @@ from pathlib import Path
from typing import Any, Union
import pytest
from libbot import sync
from libbot.utils import json_read, json_write
@pytest.mark.parametrize(
@@ -25,7 +24,7 @@ from libbot import sync
],
)
def test_json_read_valid(path: Union[str, Path], expected: Any):
assert sync.json_read(path) == expected
assert json_read(path) == expected
@pytest.mark.parametrize(
@@ -37,7 +36,7 @@ def test_json_read_valid(path: Union[str, Path], expected: Any):
)
def test_json_read_invalid(path: Union[str, Path], expected: Any):
with pytest.raises(expected):
assert sync.json_read(path) == expected
assert json_read(path) == expected
@pytest.mark.parametrize(
@@ -54,7 +53,7 @@ def test_json_read_invalid(path: Union[str, Path], expected: Any):
],
)
def test_json_write(data: Any, path: Union[str, Path]):
sync.json_write(data, path)
json_write(data, path)
assert Path(path).is_file()
with open(path, "r", encoding="utf-8") as f: