def test_customize(self): if not YAMLCustomizeAddon.can_install(self.component, None): raise SkipTest('json dump configuration not supported') YAMLCustomizeAddon.create( self.component, configuration={'indent': 8, 'wrap': 1000, 'line_break': 'dos'}, ) rev = self.component.repository.last_revision self.edit_unit('Hello, world!\n', 'Nazdar svete!\n') self.get_translation().commit_pending('test', None) self.assertNotEqual(rev, self.component.repository.last_revision) commit = self.component.repository.show(self.component.repository.last_revision) self.assertIn(' try:', commit) self.assertIn('\r\n', commit)
def test_customize(self): if not YAMLCustomizeAddon.can_install(self.component, None): raise SkipTest("json dump configuration not supported") YAMLCustomizeAddon.create( self.component, configuration={"indent": 8, "wrap": 1000, "line_break": "dos"}, ) rev = self.component.repository.last_revision self.edit_unit("Hello, world!\n", "Nazdar svete!\n") self.get_translation().commit_pending("test", None) self.assertNotEqual(rev, self.component.repository.last_revision) commit = self.component.repository.show(self.component.repository.last_revision) self.assertIn(" try:", commit) self.assertIn("cs.yml", commit) with open(self.get_translation().get_filename(), "rb") as handle: self.assertIn(b"\r\n", handle.read())