def test_signal_server(os_kill): unix.pid_store("test_signal_server", pid_file_path="/tmp") unix.kill_server("test_signal_server", pid_file_path="/tmp") assert_true(os_kill.called) os_kill.reset unix.reload_server("test_signal_server", pid_file_path="/tmp") assert_true(os_kill.called) os_kill.reset os.unlink("/tmp/test_signal_server.pid")
def test_pid_remove_dead_still_running(): unix.pid_store("test_pid_remove_dead", pid_file_path="/tmp") unix.pid_remove_dead("test_pid_remove_dead", pid_file_path="/tmp") assert_true(os.path.exists("/tmp/test_pid_remove_dead.pid"))
def test_pid_remove_dead(): unix.pid_store("test_pid_remove_dead", pid_file_path="/tmp") unix.pid_remove_dead("test_pid_remove_dead", pid_file_path="/tmp") assert_false(os.path.exists("/tmp/test_pid_remove_dead.pid"))
def test_still_running_stale_process(): unix.pid_store("test_still_running", pid_file_path="/tmp") assert_false(unix.still_running("test_still_running", pid_file_path="/tmp")) os.unlink("/tmp/test_still_running.pid")
def test_still_running(): unix.pid_store("test_still_running", pid_file_path="/tmp") assert_true(unix.still_running("test_still_running", pid_file_path="/tmp")) os.unlink("/tmp/test_still_running.pid")
def test_pid_read(): unix.pid_store("test_pid_read", pid_file_path="/tmp") pid = unix.pid_read("test_pid_read", pid_file_path="/tmp") assert_equal(pid, os.getpid()) os.unlink("/tmp/test_pid_read.pid")
def test_pid_store(): unix.pid_store("testing", pid_file_path="/tmp") assert_equal(os.path.exists("/tmp/testing.pid"), True, "Didn't make /tmp/testing.pid") os.unlink("/tmp/testing.pid")