mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-20 18:06:08 -05:00
[V3 Config] Fix unloading and implement singleton driver (#1458)
* Add the identifier as an initialization parameter * Remove config object singleton and opt for a shared JSON datastore * Fix bot unloading to deal with memory leaks * Fix tests * Fix clear all bug
This commit is contained in:
@@ -298,6 +298,16 @@ async def test_member_clear_all(config, member_factory):
|
||||
assert len(await config.all_members()) == 0
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_clear_all(config):
|
||||
await config.foo.set(True)
|
||||
assert await config.foo() is True
|
||||
|
||||
await config.clear_all()
|
||||
with pytest.raises(KeyError):
|
||||
await config.get_raw('foo')
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_clear_value(config):
|
||||
await config.foo.set(True)
|
||||
|
||||
Reference in New Issue
Block a user