Copilot commented on code in PR #11797: URL: https://github.com/apache/gravitino/pull/11797#discussion_r3503129221
########## clients/client-python/tests/unittests/test_gvfs_filename_encoding.py: ########## @@ -0,0 +1,188 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +"""Tests for file name encoding and special-character handling in GVFS. + +See https://github.com/apache/gravitino/issues/5869. These tests verify that +the GVFS path-conversion layer round-trips file names containing spaces, +URL-significant ASCII characters, multi-byte Unicode (CJK / accents / Cyrillic), +emoji, and path-structure characters without garbling them. + +The conversion functions exercised here are effectively pure given their string +arguments, so the local storage handler (``LOCA_HANDLER``) and the +``gvfs_utils`` helpers are called directly without mocking a Gravitino server. + +Finding: because Python 3 ``str`` is Unicode, every special-character category +below converts and round-trips correctly. The single confirmed defect is the +all-occurrences ``str.replace`` in ``actual_path_to_gvfs_path`` (documented via +``unittest.expectedFailure`` below); fixing it is left to a follow-up under the +parent epic #5504. +""" + +import unittest + +from gravitino import NameIdentifier +from gravitino.filesystem.gvfs_storage_handler import LOCA_HANDLER +from gravitino.filesystem.gvfs_utils import ( + extract_identifier, + get_sub_path_from_virtual_path, + to_gvfs_path_prefix, +) + +# pylint: disable=protected-access Review Comment: `# pylint: disable=protected-access` appears unnecessary in this test file (no protected/private members are accessed). Keeping it can trigger pylint's “useless suppression” noise and makes it harder to understand why the disable exists. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
