Beispiel #1
0
    def test_noCountryNameFromUnknownLocale(self):
        """Smoke tests `languageHandler.englishCountryNameFromNVDALocale`
		with locale names unknown to Windows"""
        self.assertIsNone(
            languageHandler.englishCountryNameFromNVDALocale("an"))
        self.assertIsNone(
            languageHandler.englishCountryNameFromNVDALocale("kmr"))
Beispiel #2
0
def generateUnsupportedWindowsLocales():
	"""Generates list of languages which are not supported under the current version of Windows.
	Uses `localesData.LANG_NAMES_TO_LOCALIZED_DESCS` as a base but filters further
	since unsupported languages are different under different systems."""
	unsupportedLangs = set()
	for localeName in LANG_NAMES_TO_LOCALIZED_DESCS.keys():
		# `languageHandler.englishCountryNameFromNVDALocale` returns `None` for locale unknown to Windows.
		if not languageHandler.englishCountryNameFromNVDALocale(localeName):
			unsupportedLangs.add(localeName)
	return unsupportedLangs
Beispiel #3
0
	def test_ValidEnglishCountryNamesAreReturned(self):
		"""Smoke tests `languageHandler.englishCountryNameFromNVDALocale` with some known locale names"""
		self.assertEqual(languageHandler.englishCountryNameFromNVDALocale("en"), "United States")
		self.assertEqual(languageHandler.englishCountryNameFromNVDALocale("de"), "Germany")
		self.assertEqual(languageHandler.englishCountryNameFromNVDALocale("ne"), "Nepal")
		self.assertEqual(languageHandler.englishCountryNameFromNVDALocale("pt-BR"), "Brazil")
		self.assertEqual(languageHandler.englishCountryNameFromNVDALocale("pt-PT"), "Portugal")
		self.assertEqual(languageHandler.englishCountryNameFromNVDALocale("de_CH"), "Switzerland")
Beispiel #4
0
	def test_englishCountryNameFromNVDALocaleLocaleWithDot(self):
		"""Ensures that `languageHandler.englishCountryNameFromNVDALocale` removes all dots
		from the affected country names."""
		self.assertEqual(languageHandler.englishCountryNameFromNVDALocale("zh_HK"), "Hong Kong SAR")