Added optional missing_ok to config_delete
This commit is contained in:
@@ -3,7 +3,7 @@ from typing import Any, List
|
||||
|
||||
import pytest
|
||||
|
||||
from libbot import config_delete, config_get, config_set, sync
|
||||
from libbot import config_delete, config_get, config_set
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@@ -58,3 +58,17 @@ async def test_config_set(key: str, path: List[str], value: Any, location_config
|
||||
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))
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.parametrize(
|
||||
"key, path",
|
||||
[
|
||||
("bot_lol", ["bot"]),
|
||||
],
|
||||
)
|
||||
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
|
||||
)
|
||||
|
Reference in New Issue
Block a user