def layout_variant_joining_test(self): """Should correctly join keyboard layout and variant to a string spec.""" # both layout and variant specified self.assertEqual(keyboard._join_layout_variant("cz", "qwerty"), "cz (qwerty)") # no variant specified self.assertEqual(keyboard._join_layout_variant("cz"), "cz")
def layout_variant_parse_join_test(self): """Parsing and joining valid layout and variant spec should have no effect.""" specs = ("cz", "cz (qwerty)") for spec in specs: (layout, variant) = keyboard.parse_layout_variant(spec) self.assertEqual(spec, keyboard._join_layout_variant(layout, variant))