def test_add_metadata_optimization_passes_string(self, tmp_path):
        """Test handling of optimization_passes as string instead of list."""
        # Setup
        model_attributes = {"optimization_passes": "SinglePassAsString"}
        input_model = get_onnx_model(model_attributes=model_attributes)
        config = {"graph_name": "string_pass_graph", "add_optimization_info": True}
        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 metadata_dict["optimization_passes"] == "SinglePassAsString"
Test handling of optimization_passes as string instead of list.
test/unit_test/passes/onnx/test_add_metadata.py