code: def test_project_doc2path(app):
      source_suffix = {
          ".rst": "restructuredtext",
          ".txt": "restructuredtext",
      }
  
      project = Project(app.srcdir, source_suffix)
      project.discover()
  
      # absolute path
      assert project.doc2path("index", absolute=True) == str(
          app.srcdir / "index.rst"
      )
  
      # relative path
      assert project.doc2path("index", absolute=False) == "index.rst"
  
      # first source_suffix is used for missing file
      assert project.doc2path("foo", absolute=False) == "foo.rst"
  
      # matched source_suffix is used if exists
      (app.srcdir / "bar.txt").touch()
      project.discover()
      assert project.doc2path("bar", absolute=False) == "bar.txt"
  
file_path: sphinx/tests/test_project.py
imports: import pytest
  from sphinx.project import Project
label_desc: Use image node_id 7 for calling a global function with example usage: test_project_doc2path(app) without return types