Added nested_delete and config_delete
This commit is contained in:
@@ -3,7 +3,7 @@ from typing import Any, List
|
||||
|
||||
import pytest
|
||||
|
||||
from libbot import config_get, config_set
|
||||
from libbot import config_delete, config_get, config_set, sync
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@@ -46,3 +46,15 @@ async def test_config_get_invalid(
|
||||
async def test_config_set(key: str, path: List[str], value: Any, location_config: Path):
|
||||
await config_set(key, value, *path, config_file=location_config)
|
||||
assert await config_get(key, *path, config_file=location_config) == value
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.parametrize(
|
||||
"key, path",
|
||||
[
|
||||
("bot_token", ["bot"]),
|
||||
],
|
||||
)
|
||||
async def test_config_delete(key: str, path: List[str], location_config: Path):
|
||||
await config_delete(key, *path, config_file=location_config)
|
||||
assert key not in (await config_get(*path, config_file=location_config))
|
||||
|
Reference in New Issue
Block a user