This commit is contained in:
wrrrzr 2024-05-07 15:54:50 +03:00 committed by GitHub
commit 752ad9f0c3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 23 additions and 0 deletions

View file

@ -43,3 +43,9 @@ class TestStorages:
"foo": "bar",
"baz": "spam",
}
async def test_get_value(self, bot: MockedBot, storage: BaseStorage, storage_key: StorageKey):
await storage.set_data(key=storage_key, data={"hello": "world"})
assert await storage.get_value(key=storage_key, data_key="hello") == "world"
assert await storage.get_value(key=storage_key, data_key="12345") is None
assert await storage.get_value(key=storage_key, data_key="qwerty", default=42) == 42