def test_escaping_newline_tabs(self): """test that we handle all kinds of newline permutations""" dtdsource = '<!ENTITY noupdatesfound.intro "A hard coded newline.\\nAnd tab\\t and a \\r carriage return.">\n' converter = dtd2po.dtd2po() thedtd = dtd.dtdunit() thedtd.parse(dtdsource) thepo = po.pounit() converter.convertstrings(thedtd, thepo) print(thedtd) print(thepo.source) # \n in a dtd should also appear as \n in the PO file assert thepo.source == r"A hard coded newline.\nAnd tab\t and a \r carriage return."
def convertunit(self, inputunit): dtdunit = dtd.dtdunit() self.convertcomments(inputunit, dtdunit) self.convertstrings(inputunit, dtdunit) return dtdunit