@@ -40,35 +40,40 @@ def test_python_name_conversion(self):
4040 """Test conversion of property names to Python-style kebab-case names"""
4141 test_cases = [
4242 # Simple properties
43- (SONAR_HOST_URL , "sonar.host.url" ),
44- (SONAR_TOKEN , "sonar.token" ),
45- (SONAR_VERBOSE , "sonar.verbose" ),
43+ (SONAR_HOST_URL , [ "sonar.host.url" ] ),
44+ (SONAR_TOKEN , [ "sonar.token" ] ),
45+ (SONAR_VERBOSE , [ "sonar.verbose" ] ),
4646 # CamelCase properties
47- (SONAR_SCANNER_APP_VERSION , "sonar.scanner.app-version" ),
48- (SONAR_SCANNER_SOCKET_TIMEOUT , "sonar.scanner.socket-timeout" ),
49- (SONAR_SCANNER_PROXY_PASSWORD , "sonar.scanner.proxy-password" ),
47+ (SONAR_SCANNER_APP_VERSION , [ "sonar.scanner.app-version" ] ),
48+ (SONAR_SCANNER_SOCKET_TIMEOUT , [ "sonar.scanner.socket-timeout" ] ),
49+ (SONAR_SCANNER_PROXY_PASSWORD , [ "sonar.scanner.proxy-password" ] ),
5050 # Complex properties
51- (SONAR_SCANNER_INTERNAL_DUMP_TO_FILE , "sonar.scanner.internal.dump-to-file" ),
52- (SONAR_PROJECT_KEY , "sonar.project-key" ),
53- (SONAR_PROJECT_BASE_DIR , "sonar.project-base-dir" ),
51+ (SONAR_SCANNER_INTERNAL_DUMP_TO_FILE , ["sonar.scanner.internal.dump-to-file" ]),
52+ (SONAR_PROJECT_KEY , ["sonar.project-key" ]),
53+ (SONAR_PROJECT_BASE_DIR , ["sonar.project-base-dir" ]),
54+ # Python-specific properties with alternative names
55+ ("sonar.python.pylint.reportPath" , ["sonar.python.pylint.report-path" , "sonar.pylint.report-path" ]),
56+ (
57+ "sonar.python.coverage.reportPaths" ,
58+ ["sonar.python.coverage.report-paths" , "sonar.coverage.report-paths" ],
59+ ),
60+ ("sonar.python.version" , ["sonar.python.version" ]), # No alternative name (only 3 parts)
5461 ]
5562
56- for name , expected_python_name in test_cases :
57- # Find property in PROPERTIES list
63+ for name , expected_python_names in test_cases :
5864 prop = next ((p for p in PROPERTIES if p .name == name ), None )
5965 if prop :
6066 self .assertEqual (
61- prop .python_name (),
62- expected_python_name ,
63- f"Failed to convert { name } to Python name , got { prop .python_name ()} " ,
67+ prop .python_names (),
68+ expected_python_names ,
69+ f"Failed to convert { name } to Python names , got { prop .python_names ()} " ,
6470 )
6571 else :
66- # Create test property if not in list
6772 prop = Property (name = name , default_value = None )
6873 self .assertEqual (
69- prop .python_name (),
70- expected_python_name ,
71- f"Failed to convert { name } to Python name , got { prop .python_name ()} " ,
74+ prop .python_names (),
75+ expected_python_names ,
76+ f"Failed to convert { name } to Python names , got { prop .python_names ()} " ,
7277 )
7378
7479 def test_env_variable_name_conversion (self ):
0 commit comments