def test_load_data_with_metadata(self):
        """Tests data loading with specified metadata fields."""
        docs = self.reader.load_data(
            "space1", metadata_names=["path", "title", "description", "parent"]
        )
        self.assertEqual(len(docs), 2)
        first_doc = docs[0]
        self.assertEqual(first_doc.metadata["title"], "Getting Started")
        self.assertEqual(first_doc.metadata["description"], "Guide to get started")
        self.assertIsNone(first_doc.metadata["parent"])

        second_doc = docs[1]
        self.assertEqual(second_doc.metadata["title"], "Advanced Features")
        self.assertEqual(second_doc.metadata["parent"], "page1")
Tests data loading with specified metadata fields.
llama-index-integrations/readers/llama-index-readers-gitbook/tests/test_simple_gitbook_reader.py