def test_concat_filter(self): mass.concat(self.dir.name, '/*.txt', self.dir.name + '/output.txt', fltr='^A{7}$') with open(self.dir.name + '/output.txt') as f: lines = f.readlines() self.assertEqual(len(lines), 5) for line in lines: self.assertRegex(line, 'A+\n')
def test_concat(self): """Concatenates all files into a new output file.""" mass.concat(self.dir.name, '/*.txt', self.dir.name + '/output.txt') with open(self.dir.name + '/output.txt') as f: lines = f.readlines() self.assertEqual(len(lines), 10) for line in lines: self.assertRegex(line, 'A+\n')