Updated to 0.2.1
This commit is contained in:
@@ -13,11 +13,8 @@ from libbot import sync
|
||||
(["bot_token", "bot"], "sample_token"),
|
||||
],
|
||||
)
|
||||
def test_config_get_valid(args: List[str], expected: str):
|
||||
assert (
|
||||
sync.config_get(args[0], *args[1:], config_file=Path("tests/config.json"))
|
||||
== expected
|
||||
)
|
||||
def test_config_get_valid(args: List[str], expected: str, location_config: Path):
|
||||
assert sync.config_get(args[0], *args[1:], config_file=location_config) == expected
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -26,11 +23,10 @@ def test_config_get_valid(args: List[str], expected: str):
|
||||
(["bot_stonks", "bot"], pytest.raises(KeyError)),
|
||||
],
|
||||
)
|
||||
def test_config_get_invalid(args: List[str], expected: Any):
|
||||
def test_config_get_invalid(args: List[str], expected: Any, location_config: Path):
|
||||
with expected:
|
||||
assert (
|
||||
sync.config_get(args[0], *args[1:], config_file=Path("tests/config.json"))
|
||||
== expected
|
||||
sync.config_get(args[0], *args[1:], config_file=location_config) == expected
|
||||
)
|
||||
|
||||
|
||||
@@ -41,6 +37,6 @@ def test_config_get_invalid(args: List[str], expected: Any):
|
||||
("bot_token", ["bot"], "sample_token"),
|
||||
],
|
||||
)
|
||||
def test_config_set(key: str, path: List[str], value: Any):
|
||||
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
|
||||
def test_config_set(key: str, path: List[str], value: Any, location_config: Path):
|
||||
sync.config_set(key, value, *path, config_file=location_config)
|
||||
assert sync.config_get(key, *path, config_file=location_config) == value
|
||||
|
Reference in New Issue
Block a user