Exemplo n.º 1
0
    def test_list_translations_no_locale_dir(self):
        cwd = os.getcwd()
        os.chdir(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'resources', 'locale'))

        self.assertEqual(i18n.list_translations(), [])

        os.chdir(cwd)
Exemplo n.º 2
0
    def test_list_translations_no_locale_dir(self):
        cwd = os.getcwd()
        os.chdir(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'resources', 'locale'))

        self.assertEqual(i18n.list_translations(), [])

        os.chdir(cwd)
Exemplo n.º 3
0
    def test_list_translations(self):
        cwd = os.getcwd()
        os.chdir(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'resources'))

        translations = i18n.list_translations()

        self.assertEqual(len(translations), 2)
        self.assertEqual(translations[0].language, 'en')
        self.assertEqual(translations[0].territory, 'US')
        self.assertEqual(translations[1].language, 'pt')
        self.assertEqual(translations[1].territory, 'BR')

        os.chdir(cwd)
Exemplo n.º 4
0
    def test_list_translations(self):
        cwd = os.getcwd()
        os.chdir(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'resources'))

        translations = i18n.list_translations()

        self.assertEqual(len(translations), 2)
        self.assertEqual(translations[0].language, 'en')
        self.assertEqual(translations[0].territory, 'US')
        self.assertEqual(translations[1].language, 'pt')
        self.assertEqual(translations[1].territory, 'BR')

        os.chdir(cwd)