예제 #1
0
파일: test_pid.py 프로젝트: elasti-rans/pid
def test_pid_already_closed():
    pidfile = pid.PidFile()
    pidfile.create()
    try:
        pidfile.fh.close()
    finally:
        pidfile.close()
예제 #2
0
파일: test_pid.py 프로젝트: elasti-rans/pid
def test_pid_check_samepid():
    pidfile = pid.PidFile(allow_samepid=True)
    try:
        pidfile.create()
        pidfile.create()
    finally:
        pidfile.close()
예제 #3
0
파일: test_pid.py 프로젝트: steph-ben/pid
def test_pid_check_samepid():
    pidfile = pid.PidFile(allow_samepid=True)
    try:
        pidfile.create()
        pidfile.create()
    finally:
        pidfile.close()
예제 #4
0
파일: test_pid.py 프로젝트: steph-ben/pid
def test_pid_already_closed():
    pidfile = pid.PidFile()
    pidfile.create()
    try:
        pidfile.fh.close()
    finally:
        pidfile.close()
예제 #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)
예제 #6
0
파일: test_pid.py 프로젝트: elasti-rans/pid
def test_pid_multiplecreate():
    pidfile = pid.PidFile()
    pidfile.create()
    try:
        with raising(pid.PidFileAlreadyRunningError, pid.PidFileAlreadyLockedError):
            pidfile.create()
    finally:
        pidfile.close()
예제 #7
0
파일: test_pid.py 프로젝트: mgorny/pid
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)
예제 #8
0
파일: test_pid.py 프로젝트: steph-ben/pid
def test_pid_multiplecreate():
    pidfile = pid.PidFile()
    pidfile.create()
    try:
        with raising(pid.PidFileAlreadyRunningError,
                     pid.PidFileAlreadyLockedError):
            pidfile.create()
    finally:
        pidfile.close()
예제 #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)