17 lines
423 B
Python
17 lines
423 B
Python
from app.inbox_locks import InboxRunLocks
|
|
|
|
|
|
def test_inbox_run_locks_serialize_different_inboxes():
|
|
locks = InboxRunLocks()
|
|
first = locks.acquire("first", blocking=False)
|
|
assert first is not None
|
|
|
|
try:
|
|
assert locks.acquire("second", blocking=False) is None
|
|
finally:
|
|
first.release()
|
|
|
|
second = locks.acquire("second", blocking=False)
|
|
assert second is not None
|
|
second.release()
|