Example #1
0
 def testMultipleDictionaries(self):
     stringer.loaddictionary(ENGLISH_TEST_PATH)
     stringer.loaddictionary(DEUTSCH_TEST_PATH)
     
     _ = stringer.Stringer
     
     self.assertEqual(_("_hello world"),
                      "hello world",
                      "'en' is our default language key.")
     
     stringer.setkey("de")
     
     self.assertEqual(_("_hello world"),
                      "Hallo Welt",
                      "Can change language keys and keep more than one dictionary in memory.")
Example #2
0
 def testSetKey(self):
     stringer.setkey("de")
     self.assertEqual(stringer.DICTIONARY_KEY,
                      "de",
                      "setkey changes the DICTIONARY_KEY.")