code: def test_from_dict(self):
      data = {
          "type": "haystack.components.writers.document_writer.DocumentWriter",
          "init_parameters": {
              "document_store": {
                  "type": "haystack.document_stores.in_memory.document_store.InMemoryDocumentStore",
                  "init_parameters": {},
              },
              "policy": "SKIP",
          },
      }
      component = DocumentWriter.from_dict(data)
      assert isinstance(component.document_store, InMemoryDocumentStore)
      assert component.policy == DuplicatePolicy.SKIP
  
file_path: haystack/test/components/writers/test_document_writer.py
imports: import pytest
  from haystack import Document, DeserializationError
  from haystack.testing.factory import document_store_class
  from haystack.components.writers.document_writer import DocumentWriter
  from haystack.document_stores.types import DuplicatePolicy
  from haystack.document_stores.in_memory import InMemoryDocumentStore
label_desc: Use image node_id 3 for calling the TestDocumentWriter obj's underlying member method code with example usage: obj.test_from_dict() without return types