def test_simple(self): merge_files(os.path.join(TEST_PATH, "test_files", "merged.txt"), [os.path.join(TEST_PATH, "test_files", "f1"), os.path.join(TEST_PATH, "test_files", "f2"), os.path.join(TEST_PATH, "test_files", "f3")], ["+ ","- ", "~ "]) with open(os.path.join(TEST_PATH, "test_files", "merged.txt")) as f: self.assertEqual(f.read().strip(), "+ 1a\n- 2a\n~ 3a\n\n+ 1b\n- 2b\n~ 3b\n\n+ \n- 2c\n~ 3c\n\n+ 1c\n- 2d")
def test_simple(self): merge_files(os.path.join(TEST_PATH, "test_files", "merged.txt"), [ os.path.join(TEST_PATH, "test_files", "f1"), os.path.join(TEST_PATH, "test_files", "f2"), os.path.join(TEST_PATH, "test_files", "f3") ], ["+ ", "- ", "~ "]) with open(os.path.join(TEST_PATH, "test_files", "merged.txt")) as f: self.assertEqual( f.read().strip(), "+ 1a\n- 2a\n~ 3a\n\n+ 1b\n- 2b\n~ 3b\n\n+ \n- 2c\n~ 3c\n\n+ 1c\n- 2d" )
def merge_translations(args): annotation_list = [ '- ', '+ ', '~ ', '> ', '= ', '* ', '# ', '$ ', '^ ', '% ', '& ', '@ ' ] merge_files(args.t_output_file, args.t_input_files, annotation_list)
def merge_translations(args): annotation_list = ['- ', '+ ', '~ ', '> ', '= ', '* ', '# ', '$ ', '^ ', '% ', '& ', '@ '] merge_files(args.t_output_file, args.t_input_files, annotation_list)
def test_bad_file(self): with self.assertRaises(Exception): merge_files(os.path.join(TEST_PATH, "temp_files", "merged.txt"), [os.path.join(TEST_PATH, "test_files", "fdafda1")], ["+ "])
def test_annotation_failure(self): with self.assertRaises(Exception): merge_files(os.path.join(TEST_PATH, "temp_files", "merged.txt"), [ os.path.join(TEST_PATH, "test_files", "f1"), os.path.join(TEST_PATH, "test_files", "f2") ], ["+ "])
def test_empty(self): merge_files(os.path.join(TEST_PATH, "temp_files", "merged.txt"), [os.path.join(TEST_PATH, "test_files", "empty.txt")], ["+ "]) with open(os.path.join(TEST_PATH, "temp_files", "merged.txt")) as f: self.assertEqual(f.read().strip(), "")
def test_annotation_failure(self): with self.assertRaises(Exception): merge_files(os.path.join(TEST_PATH, "temp_files", "merged.txt"), [os.path.join(TEST_PATH, "test_files", "f1"), os.path.join(TEST_PATH, "test_files", "f2")], ["+ "])