def test_add_metadata_basic(self, tmp_path):
        """Test basic metadata addition with required graph_name and automatic Olive version."""
        # Setup
        input_model = get_onnx_model()
        config = {"graph_name": "test_graph"}
        p = create_pass_from_dict(AddOliveMetadata, config, disable_search=True)
        output_folder = str(tmp_path / "onnx")

        # Execute
        output_model = p.run(input_model, output_folder)

        # Assert
        assert Path(output_model.model_path).exists()
        # Load the output model and check graph name
        onnx_model = onnx.load_model(output_model.model_path)
        assert onnx_model.graph.name == "test_graph"

        # Check that Olive version is always added
        metadata_dict = {entry.key: entry.value for entry in onnx_model.metadata_props}
        assert "olive_version" in metadata_dict
Test basic metadata addition with required graph_name and automatic Olive version.
test/unit_test/passes/onnx/test_add_metadata.py