You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
725 B

  1. '''
  2. Created on Jan 25, 2014
  3. @author: Chris
  4. '''
  5. import unittest
  6. import i18n
  7. import i18n_config
  8. # from i18n import I18N
  9. #
  10. class Test(unittest.TestCase):
  11. def test_i18n_loads_module_by_name(self):
  12. self.assertTrue(i18n._DICTIONARY is None)
  13. i18n.load('english')
  14. self.assertTrue(i18n._DICTIONARY is not None)
  15. self.assertEqual('Cancel', i18n.translate('cancel'))
  16. i18n.load('french')
  17. self.assertEqual('Annuler', i18n.translate('cancel'))
  18. def test_i18n_throws_exception_on_no_lang_file_found(self):
  19. self.assertRaises(IOError, i18n.load, 'chionenglish')
  20. if __name__ == "__main__":
  21. pass
  22. #import sys;sys.argv = ['', 'Test.testName']
  23. unittest.main()