[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:
zephyrkul
2018-10-04 21:03:27 -06:00
committed by Toby Harradine
parent 80506856fb
commit ebc657dcc6
3 changed files with 64 additions and 0 deletions

View File

@@ -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