Skip to content

Commit

Permalink
Add test for GetLocaleKeyboardLayouts
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkankovsky committed Jan 14, 2025
1 parent 01ddb56 commit b14b523
Showing 1 changed file with 54 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,60 @@ def test_locale_data(self):
}
assert data == english_us

def test_keyboard_layouts_for_language(self):
get_keyboard_layouts = self.localization_interface.GetLocaleKeyboardLayouts
layouts = get_keyboard_layouts("cs_CZ.UTF-8")

expected_layouts = [
{
"description": "Czech (extra backslash)",
"layoutId": "cz",
"variantId": "bksl",
},
{
"description": "Czech (QWERTY)",
"layoutId": "cz",
"variantId": "qwerty",
},
{
"description": "Czech (QWERTY, extra backslash)",
"layoutId": "cz",
"variantId": "qwerty_bksl",
},
{
"description": "Czech (QWERTZ, Windows)",
"layoutId": "cz",
"variantId": "winkeys",
},
{
"description": "Czech (QWERTY, Windows)",
"layoutId": "cz",
"variantId": "winkeys-qwerty",
},
{
"description": "Czech (QWERTY, Macintosh)",
"layoutId": "cz",
"variantId": "qwerty-mac",
},
{
"description": "Czech (UCW, only accented letters)",
"layoutId": "cz",
"variantId": "ucw",
},
{
"description": "Czech (US, Dvorak, UCW support)",
"layoutId": "cz",
"variantId": "dvorak-ucw",
},
{
"description": "Russian (Czechia, phonetic)",
"layoutId": "cz",
"variantId": "rus",
},
]

assert layouts == expected_layouts

def test_common_locales(self):
common_locales = self.localization_interface.GetCommonLocales()

Expand Down

0 comments on commit b14b523

Please sign in to comment.