mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
- rename LockFile.lock to acquire - rename LockFile.unlock to release - move the lockfile management in sepate functions inside the arbiter - remove the "closed" argument from the socket.close method and add a new "destroy" function that will be called whent the socket can be unlinked (cal release) - fix tests
16 lines
455 B
Python
16 lines
455 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.released() == True
|
|
assert os.path.exists(lockname)
|
|
lock_file.acquire()
|
|
assert lock_file.released() == False
|
|
lock_file.release()
|
|
assert lock_file.released() == True
|
|
assert os.path.exists(lockname) == False
|