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

@@ -1,3 +1,4 @@
from pathlib import Path
from typing import Any, List
import pytest
@@ -14,7 +15,10 @@ from libbot import config_get, config_set
],
)
async def test_config_get_valid(args: List[str], expected: str):
assert await config_get(args[0], *args[1:]) == expected
assert (
await config_get(args[0], *args[1:], config_file=Path("tests/config.json"))
== expected
)
@pytest.mark.asyncio
@@ -26,7 +30,10 @@ async def test_config_get_valid(args: List[str], expected: str):
)
async def test_config_get_invalid(args: List[str], expected: Any):
with expected:
assert await config_get(args[0], *args[1:]) == expected
assert (
await config_get(args[0], *args[1:], config_file=Path("tests/config.json"))
== expected
)
@pytest.mark.asyncio
@@ -38,5 +45,5 @@ async def test_config_get_invalid(args: List[str], expected: Any):
],
)
async def test_config_set(key: str, path: List[str], value: Any):
await config_set(key, value, *path)
assert await config_get(key, *path) == value
await config_set(key, value, *path, config_file=Path("tests/config.json"))
assert await config_get(key, *path, config_file=Path("tests/config.json")) == value