Update test_db_lock with new function name

This commit is contained in:
sabaimran 2024-08-08 13:03:01 +05:30
parent 64b2073e63
commit c08b9e89f0

View file

@ -13,7 +13,7 @@ def test_process_lock(default_process_lock):
lock: ProcessLock = default_process_lock
# Assert
assert True == ProcessLockAdapters.is_process_locked(lock.name)
assert True == ProcessLockAdapters.is_process_locked_by_name(lock.name)
@pytest.mark.django_db(transaction=True)
@ -25,7 +25,7 @@ def test_expired_process_lock():
time.sleep(3)
# Assert
assert False == ProcessLockAdapters.is_process_locked(lock.name)
assert False == ProcessLockAdapters.is_process_locked_by_name(lock.name)
@pytest.mark.django_db(transaction=True)
@ -37,7 +37,7 @@ def test_in_progress_lock(default_process_lock):
ProcessLockAdapters.run_with_lock(lock.name, lambda: time.sleep(2))
# Assert
assert True == ProcessLockAdapters.is_process_locked(lock.name)
assert True == ProcessLockAdapters.is_process_locked_by_name(lock.name)
@pytest.mark.django_db(transaction=True)
@ -49,10 +49,10 @@ def test_run_with_completed():
time.sleep(4)
# Assert
assert False == ProcessLockAdapters.is_process_locked("test_run_with")
assert False == ProcessLockAdapters.is_process_locked_by_name("test_run_with")
@pytest.mark.django_db(transaction=True)
def test_nonexistent_lock():
# Assert
assert False == ProcessLockAdapters.is_process_locked("nonexistent_lock")
assert False == ProcessLockAdapters.is_process_locked_by_name("nonexistent_lock")