mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-20 18:06:08 -05:00
[Config] Add Group.clear_raw method (#2178)
Adds a `clear_raw` method to Group objects, similar to the existing `get_raw` and `set_raw` methods. Documentation included.
This commit is contained in:
committed by
Toby Harradine
parent
80506856fb
commit
ebc657dcc6
@@ -224,6 +224,15 @@ async def test_set_dynamic_attr(config):
|
||||
assert await config.foobar() is True
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_clear_dynamic_attr(config):
|
||||
await config.foo.set(True)
|
||||
await config.clear_raw("foo")
|
||||
|
||||
with pytest.raises(KeyError):
|
||||
await config.get_raw("foo")
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_get_dynamic_attr(config):
|
||||
assert await config.get_raw("foobaz", default=True) is True
|
||||
|
||||
Reference in New Issue
Block a user