def test_add_metadata_without_optimization_info(self, tmp_path):
        """Test that optimization info is not added when disabled."""
        # Setup
        model_attributes = {
            "original_model_path": "/path/to/original/model.onnx",
            "optimization_passes": ["OnnxTransformerOptimization"],
        }
        input_model = get_onnx_model(model_attributes=model_attributes)
        config = {"graph_name": "no_opt_info_graph", "add_optimization_info": False}
        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
        onnx_model = onnx.load_model(output_model.model_path)
        metadata_dict = {entry.key: entry.value for entry in onnx_model.metadata_props}

        assert "original_model_path" not in metadata_dict
        assert "optimization_passes" not in metadata_dict
Test that optimization info is not added when disabled.
test/unit_test/passes/onnx/test_add_metadata.py