コード例 #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)