Changed path to tests/

This commit is contained in:
2023-08-06 02:08:02 +02:00
parent e508f37089
commit b6537a50ae
4 changed files with 34 additions and 20 deletions

View File

@@ -12,13 +12,13 @@ from libbot import json_read, json_write
"path, expected",
[
(
"data/test.json",
"tests/data/test.json",
{
"foo": "bar",
"abcdefg": ["higklmnop", {"lol": {"kek": [1.0000035, 0.2542, 1337]}}],
},
),
("data/empty.json", {}),
("tests/data/empty.json", {}),
],
)
async def test_json_read_valid(path: Union[str, Path], expected: Any):
@@ -29,8 +29,8 @@ async def test_json_read_valid(path: Union[str, Path], expected: Any):
@pytest.mark.parametrize(
"path, expected",
[
("data/invalid.json", pytest.raises(JSONDecodeError)),
("data/nonexistent.json", pytest.raises(FileNotFoundError)),
("tests/data/invalid.json", pytest.raises(JSONDecodeError)),
("tests/data/nonexistent.json", pytest.raises(FileNotFoundError)),
],
)
async def test_json_read_invalid(path: Union[str, Path], expected: Any):
@@ -47,9 +47,9 @@ async def test_json_read_invalid(path: Union[str, Path], expected: Any):
"foo": "bar",
"abcdefg": ["higklmnop", {"lol": {"kek": [1.0000035, 0.2542, 1337]}}],
},
"data/test.json",
"tests/data/test.json",
),
({}, "data/empty.json"),
({}, "tests/data/empty.json"),
],
)
async def test_json_write(data: Any, path: Union[str, Path]):