Changed path to tests/
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user