def test_add(self): UpdateLinguasAddon.create(self.component) UpdateConfigureAddon.create(self.component) TestAddon.create(self.component) rev = self.component.repository.last_revision self.component.add_new_language( Language.objects.get(code='sk'), None ) self.assertNotEqual(rev, self.component.repository.last_revision) commit = self.component.repository.show( self.component.repository.last_revision ) self.assertIn('po/LINGUAS', commit) self.assertIn('configure', commit)
def test_update_linguas(self): translation = self.get_translation() self.assertTrue( UpdateLinguasAddon.can_install(translation.component, None)) addon = UpdateLinguasAddon.create(translation.component) addon.post_add(translation) self.assertTrue(os.path.exists(translation.addon_commit_files[0]))
def test_update_linguas(self): translation = self.get_translation() self.assertTrue(UpdateLinguasAddon.can_install(translation.component, None)) addon = UpdateLinguasAddon.create(translation.component) commit = self.component.repository.show(self.component.repository.last_revision) self.assertIn("LINGUAS", commit) self.assertIn("\n+cs\n", commit) addon.post_add(translation) self.assertEqual(translation.addon_commit_files, []) other = self._create_component( "po", "po-duplicates/*.dpo", name="Other", project=self.project ) self.assertTrue(UpdateLinguasAddon.can_install(other, None)) addon = UpdateLinguasAddon.create(other) commit = other.repository.show(other.repository.last_revision) self.assertIn("LINGUAS", commit) self.assertIn("\n+cs de it", commit)
def test_update_linguas(self): translation = self.get_translation() self.assertTrue( UpdateLinguasAddon.is_compatible(translation.subproject) ) addon = UpdateLinguasAddon.create(translation.subproject) addon.post_add(translation) self.assertTrue( os.path.exists(translation.addon_commit_files[0]) )
def test_update_linguas(self): translation = self.get_translation() self.assertTrue( UpdateLinguasAddon.can_install(translation.component, None) ) addon = UpdateLinguasAddon.create(translation.component) addon.post_add(translation) self.assertTrue( os.path.exists(translation.addon_commit_files[0]) )