mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
80b4abd3b5
commit
24fdd285fd
4 changed files with 21 additions and 19 deletions
|
|
@ -189,14 +189,16 @@ class TestMediaGroupAggregator:
|
|||
assert await aggregator.get_group("42") == []
|
||||
|
||||
async def test_acquire_lock(self, aggregator: BaseMediaGroupAggregator):
|
||||
await aggregator.acquire_lock("42", "key1")
|
||||
assert not await aggregator.acquire_lock("42", "key2")
|
||||
await aggregator.release_lock("42", "key1")
|
||||
for i in ("key2", "key3"):
|
||||
for i in ("key1", "key2"):
|
||||
assert await aggregator.acquire_lock("42", i)
|
||||
assert not await aggregator.acquire_lock("42", i)
|
||||
await aggregator.release_lock("42", i)
|
||||
|
||||
async def test_lock_not_acquired_with_wrong_key(self, aggregator: BaseMediaGroupAggregator):
|
||||
await aggregator.acquire_lock("42", "key1")
|
||||
await aggregator.release_lock("42", "key2")
|
||||
assert not await aggregator.acquire_lock("42", "key1")
|
||||
|
||||
async def test_expired_objects_removed(self):
|
||||
aggregator = MemoryMediaGroupAggregator()
|
||||
await aggregator.add_into_group("42", _get_message(1))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue