Add tests for set_metadata()