def test_get_pofiles_for_potfile__extends(self): result = {'nl': ['something.po']} utils.get_pofiles_for_potfile(make_absolute('foo/locales/locales/plone.pot'), result) result = make_relative_recursively(result) self.assertEqual(result, {'nl': ['foo/locales/locales/nl/LC_MESSAGES/plone.po', 'something.po']})
def test_find_domains_in_path(self): self.maxDiff = None self.assertEqual( make_relative_recursively(utils.find_domains_in_path(TEST_EXAMPLE_PATH)), {'plone': { 'potfiles': ['foo/i18n/plone.pot', 'foo/locales/locales/plone.pot'], 'languages': { 'nl': ['foo/i18n/plone-nl.po', 'foo/locales/locales/nl/LC_MESSAGES/plone.po']}}, 'linguaplone': { 'potfiles': ['foo/locales/locales/linguaplone.pot'], 'languages': { 'nl': ['foo/locales/locales/nl/LC_MESSAGES/linguaplone.po']}}, })
def test_get_pofiles_for_potfile__i18n(self): result = {} utils.get_pofiles_for_potfile(make_absolute('foo/i18n/plone.pot'), result) result = make_relative_recursively(result) self.assertEqual(result, {'nl': ['foo/i18n/plone-nl.po']})
def test_find_files_in_path(self): results = make_relative_recursively(utils.find_files_in_path('pot', TEST_EXAMPLE_PATH)) self.assertEquals(results, ['foo/i18n/plone.pot', 'foo/locales/locales/linguaplone.pot', 'foo/locales/locales/plone.pot'])