mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
16 lines
446 B
Python
16 lines
446 B
Python
import os
|
|
|
|
from gunicorn.lockfile import LockFile
|
|
from gunicorn.util import tmpfile
|
|
|
|
def test_lockfile():
|
|
lockname = tmpfile(prefix="gunicorn-tests", suffix=".lock")
|
|
lock_file = LockFile(lockname)
|
|
assert lock_file.locked() == False
|
|
assert os.path.exists(lockname)
|
|
lock_file.lock()
|
|
assert lock_file.locked() == True
|
|
lock_file.unlock()
|
|
assert lock_file.locked() == False
|
|
assert os.path.exists(lockname) == False
|