def test_generate(self): self.edit_unit("Hello, world!\n", "Nazdar svete!\n") self.assertTrue(GenerateFileAddon.can_install(self.component, None)) GenerateFileAddon.create( self.component, configuration={ "filename": "stats/{{ language_code }}.json", "template": """{ "translated": {{ stats.translated_percent }} }""", }, ) self.get_translation().commit_pending("test", None) commit = self.component.repository.show(self.component.repository.last_revision) self.assertIn("stats/cs.json", commit) self.assertIn('"translated": 25', commit)
def test_generate(self): self.edit_unit('Hello, world!\n', 'Nazdar svete!\n') self.assertTrue(GenerateFileAddon.can_install(self.component, None)) GenerateFileAddon.create( self.component, configuration={ 'filename': 'stats/{{ language_code }}.json', 'template': '''{ "translated": {{ stats.translated_percent }} }''', }, ) self.get_translation().commit_pending('test', None) commit = self.component.repository.show(self.component.repository.last_revision) self.assertIn('stats/cs.json', commit) self.assertIn('"translated": 25', commit)
def test_generate(self): self.edit_unit('Hello, world!\n', 'Nazdar svete!\n') self.assertTrue(GenerateFileAddon.can_install(self.component, None)) GenerateFileAddon.create( self.component, configuration={ 'filename': 'stats/{{ language_code }}.json', 'template': '''{ "translated": {{ stats.translated_percent }} }''', } ) self.get_translation().commit_pending('test', None) commit = self.component.repository.show( self.component.repository.last_revision ) self.assertIn('stats/cs.json', commit) self.assertIn('"translated": 25', commit)