def test_produces_output(self): out_docx = DocxConfig(self.s) self.parser.write_docx(out_docx) out_docx.save(self.s.OUTPUT_FILE) # At least confirm the file was modified num_seconds = 3 self.assertTrue(time.time() - os.stat(self.s.OUTPUT_FILE).st_mtime < num_seconds)
def test_clean_effect_on_unicode(self): with open(DEFAULT_INPUT_FILE) as input: test_text = input.read() self.assertEqual(test_text.replace('\r', '\n'), DocxConfig.clean(test_text))
def test_clean_changes_slash_r_ascii(self): test_text = 'aoeuu\naoeu\raoeu\r\naoeu' self.assertEqual(test_text.replace('\r', '\n'), DocxConfig.clean(test_text))