Beispiel #1
0
def test_pid_already_closed():
    pidfile = pid.PidFile()
    pidfile.create()
    try:
        pidfile.fh.close()
    finally:
        pidfile.close()
Beispiel #2
0
def test_pid_check_samepid():
    pidfile = pid.PidFile(allow_samepid=True)
    try:
        pidfile.create()
        pidfile.create()
    finally:
        pidfile.close()
Beispiel #3
0
def test_pid_check_samepid():
    pidfile = pid.PidFile(allow_samepid=True)
    try:
        pidfile.create()
        pidfile.create()
    finally:
        pidfile.close()
Beispiel #4
0
def test_pid_already_closed():
    pidfile = pid.PidFile()
    pidfile.create()
    try:
        pidfile.fh.close()
    finally:
        pidfile.close()
Beispiel #5
0
def test_pid_already_closed():
    pidfile = pid.PidFile()
    pidfile.create()
    try:
        pidfile.fh.close()
    finally:
        pidfile.close()
    assert not os.path.exists(pidfile.filename)
Beispiel #6
0
def test_pid_multiplecreate():
    pidfile = pid.PidFile()
    pidfile.create()
    try:
        with raising(pid.PidFileAlreadyRunningError, pid.PidFileAlreadyLockedError):
            pidfile.create()
    finally:
        pidfile.close()
Beispiel #7
0
def test_pid_multiplecreate():
    pidfile = pid.PidFile()
    pidfile.create()
    try:
        with raising(pid.PidFileAlreadyRunningError, pid.PidFileAlreadyLockedError):
            pidfile.create()
    finally:
        pidfile.close()
    assert not os.path.exists(pidfile.filename)
Beispiel #8
0
def test_pid_multiplecreate():
    pidfile = pid.PidFile()
    pidfile.create()
    try:
        with raising(pid.PidFileAlreadyRunningError,
                     pid.PidFileAlreadyLockedError):
            pidfile.create()
    finally:
        pidfile.close()
Beispiel #9
0
    def check_samepid():
        pidfile = pid.PidFile(allow_samepid=True)

        try:
            pidfile.create()
            pidfile.create()
        finally:
            pidfile.close()

        assert not os.path.exists(pidfile.filename)