WIP: Overhaul for 4.0.0
This commit is contained in:
@@ -2,8 +2,7 @@ from pathlib import Path
|
||||
from typing import Any, List
|
||||
|
||||
import pytest
|
||||
|
||||
from libbot import config_delete, config_get, config_set
|
||||
from libbot.utils import config_delete, config_get, config_set
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@@ -25,14 +24,9 @@ async def test_config_get_valid(args: List[str], expected: str, location_config:
|
||||
(["bot_stonks", "bot"], pytest.raises(KeyError)),
|
||||
],
|
||||
)
|
||||
async def test_config_get_invalid(
|
||||
args: List[str], expected: Any, location_config: Path
|
||||
):
|
||||
async def test_config_get_invalid(args: List[str], expected: Any, location_config: Path):
|
||||
with expected:
|
||||
assert (
|
||||
await config_get(args[0], *args[1:], config_file=location_config)
|
||||
== expected
|
||||
)
|
||||
assert await config_get(args[0], *args[1:], config_file=location_config) == expected
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@@ -68,7 +62,4 @@ async def test_config_delete(key: str, path: List[str], location_config: Path):
|
||||
],
|
||||
)
|
||||
async def test_config_delete_missing(key: str, path: List[str], location_config: Path):
|
||||
assert (
|
||||
await config_delete(key, *path, missing_ok=True, config_file=location_config)
|
||||
is None
|
||||
)
|
||||
assert await config_delete(key, *path, missing_ok=True, config_file=location_config) is None
|
||||
|
Reference in New Issue
Block a user