def test_add_metadata_no_model_attributes(self, tmp_path):
        """Test behavior when model has no model_attributes."""
        # Setup
        input_model = get_onnx_model(model_attributes=None)
        config = {"graph_name": "no_attrs_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 - should complete successfully without errors
        onnx_model = onnx.load_model(output_model.model_path)
        assert onnx_model.graph.name == "no_attrs_graph"
        metadata_dict = {entry.key: entry.value for entry in onnx_model.metadata_props}

        # Should not have optimization info since no model_attributes
        assert "original_model_path" not in metadata_dict
        assert "optimization_passes" not in metadata_dict
Test behavior when model has no model_attributes.
test/unit_test/passes/onnx/test_add_metadata.py