feat: add localization tests and improve locale handling in tools

This commit is contained in:
OhMyApps
2025-06-23 23:35:02 +02:00
parent 3368830f05
commit a46f8c2fad
4 changed files with 144 additions and 6 deletions

View File

@@ -207,7 +207,8 @@ class TestUTF8Localization(unittest.TestCase):
# Created by: Lead Developer
# Creation date: December 15, 2024
def process_data(preferences, parameters): '''
def process_data(preferences, parameters):
'''
Processes data according to user preferences.
Args:
@@ -358,7 +359,9 @@ class TestLocalizationIntegration(unittest.TestCase):
"relevant_files": ["/test/example.py"],
"model": "test-model",
}
) # Checks
)
# Checks
self.assertIsNotNone(result)
self.assertEqual(len(result), 1)
@@ -385,8 +388,12 @@ class TestLocalizationIntegration(unittest.TestCase):
# Spanish
os.environ["LOCALE"] = "es-ES"
instruction_es = tool.get_language_instruction() # Spanish
os.environ["LOCALE"] = "es-ES"
instruction_es = tool.get_language_instruction()
self.assertIn("es-ES", instruction_es) # Chinese
self.assertIn("es-ES", instruction_es)
# Chinese
os.environ["LOCALE"] = "zh-CN"
instruction_zh = tool.get_language_instruction()
self.assertIn("zh-CN", instruction_zh)