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
@@ -13,7 +14,10 @@ from libbot import sync
],
)
def test_config_get_valid(args: List[str], expected: str):
assert sync.config_get(args[0], *args[1:]) == expected
assert (
sync.config_get(args[0], *args[1:], config_file=Path("tests/config.json"))
== expected
)
@pytest.mark.parametrize(
@@ -24,7 +28,10 @@ def test_config_get_valid(args: List[str], expected: str):
)
def test_config_get_invalid(args: List[str], expected: Any):
with expected:
assert sync.config_get(args[0], *args[1:]) == expected
assert (
sync.config_get(args[0], *args[1:], config_file=Path("tests/config.json"))
== expected
)
@pytest.mark.parametrize(
@@ -35,5 +42,5 @@ def test_config_get_invalid(args: List[str], expected: Any):
],
)
def test_config_set(key: str, path: List[str], value: Any):
sync.config_set(key, value, *path)
assert sync.config_get(key, *path) == value
sync.config_set(key, value, *path, config_file=Path("tests/config.json"))
assert sync.config_get(key, *path, config_file=Path("tests/config.json")) == value