Exemplo n.º 1
0
    def test_get_pofiles_for_untranslated_template(self):
        # If there is no POFile for a template in a language,
        # get_pofiles_for makes up a DummyPOFile.

        # Avoid circular imports.
        from lp.translations.model.pofile import DummyPOFile

        pofiles = get_pofiles_for([self.potemplate], self.greek)
        pofile = pofiles[0]
        self.assertIsInstance(pofile, DummyPOFile)
Exemplo n.º 2
0
    def test_get_pofiles_for_untranslated_template(self):
        # If there is no POFile for a template in a language,
        # get_pofiles_for makes up a DummyPOFile.

        # Avoid circular imports.
        from lp.translations.model.pofile import DummyPOFile

        pofiles = get_pofiles_for([self.potemplate], self.greek)
        pofile = pofiles[0]
        self.assertIsInstance(pofile, DummyPOFile)
Exemplo n.º 3
0
 def test_get_pofiles_for_translated_template(self):
     # get_pofiles_for finds a POFile for a given template in a given
     # language.
     greek_pofile = self._makePOFile()
     pofiles = get_pofiles_for([self.potemplate], self.greek)
     self.assertEqual([greek_pofile], pofiles)
Exemplo n.º 4
0
 def test_get_pofiles_for_empty_template_list(self):
     # get_pofiles_for sensibly returns the empty list for an empty
     # template list.
     pofiles = get_pofiles_for([], self.greek)
     self.assertEqual([], pofiles)
 def getPOFilesFor(self, potemplates):
     """See `IDistroSeriesLanguage`."""
     return get_pofiles_for(potemplates, self.language)
 def getPOFilesFor(self, potemplates):
     """See `IDistroSeriesLanguage`."""
     return get_pofiles_for(potemplates, self.language)
Exemplo n.º 7
0
 def test_get_pofiles_for_translated_template(self):
     # get_pofiles_for finds a POFile for a given template in a given
     # language.
     greek_pofile = self._makePOFile()
     pofiles = get_pofiles_for([self.potemplate], self.greek)
     self.assertEqual([greek_pofile], pofiles)
Exemplo n.º 8
0
 def test_get_pofiles_for_empty_template_list(self):
     # get_pofiles_for sensibly returns the empty list for an empty
     # template list.
     pofiles = get_pofiles_for([], self.greek)
     self.assertEqual([], pofiles)