def METHOD_NAME(self, tmpdir):
    """
    Test the list method from the ProjectManager class
    """
    config = build_config_from_dicts({"barman_lock_directory": tmpdir.strpath})
    config.name = "main"
    lockfile = tmpdir.join(".%s-receive-wal.lock" % config.name)
    # Listing the processes should not modify the lockfile content
    lockfile.write("0\n")
    pm = ProcessManager(config)
    assert pm.list("receive-wal") == []
    assert "0\n" == lockfile.read()
    # If there is a running process it must correctly read its pid
    with ServerWalReceiveLock(tmpdir.strpath, config.name):
        pm = ProcessManager(config)
        process = pm.list("receive-wal")[0]
    assert "main" == process.server_name
    assert "receive-wal" == process.task
    assert os.getpid() == process.pid
    assert str(os.getpid()) == lockfile.read().strip()