code: def test_csv_table_directive(app):
      # relative path from current document
      text = ".. csv-table::\n" "   :file: example.csv\n"
      doctree = restructuredtext.parse(
          app, text, docname="subdir/index"
      )
      assert_node(
          doctree,
          (
              [
                  nodes.table,
                  nodes.tgroup,
                  (
                      nodes.colspec,
                      nodes.colspec,
                      nodes.colspec,
                      [nodes.tbody, nodes.row],
                  ),
              ],
          ),
      )
      assert_node(
          doctree[0][0][3][0],
          (
              [nodes.entry, nodes.paragraph, "FOO"],
              [nodes.entry, nodes.paragraph, "BAR"],
              [nodes.entry, nodes.paragraph, "BAZ"],
          ),
      )
  
      # absolute path from source directory
      text = ".. csv-table::\n" "   :file: /example.csv\n"
      doctree = restructuredtext.parse(
          app, text, docname="subdir/index"
      )
      assert_node(
          doctree,
          (
              [
                  nodes.table,
                  nodes.tgroup,
                  (
                      nodes.colspec,
                      nodes.colspec,
                      nodes.colspec,
                      [nodes.tbody, nodes.row],
                  ),
              ],
          ),
      )
      assert_node(
          doctree[0][0][3][0],
          (
              [nodes.entry, nodes.paragraph, "foo"],
              [nodes.entry, nodes.paragraph, "bar"],
              [nodes.entry, nodes.paragraph, "baz"],
          ),
      )
  
imports: import pytest
  from docutils import nodes
  from sphinx.testing import restructuredtext
  from sphinx.testing.util import assert_node
label_desc: Use image node_id 2 for calling a global function with example usage: test_csv_table_directive(app) without return types