def test_rename_all_bug(self): for i in range(5): with open(self.dir.name + '/{:02d}.cfg'.format(i), 'w') as f: f.write('AAAAAAAA\nAAAAAAA\n') self.files.append(f.name) mass.rename(self.dir.name, '/*', prefix='AAA', suffix='BBB') for f in glob.glob(self.dir.name + '/*'): self.assertRegex(f, 'AAA[^B]+BBB.[txt|cfg]')
def test_rename(self): mass.rename(self.dir.name, '/*.txt', prefix='AAA', suffix='BBB', ext='.bak') for f in glob.glob(self.dir.name + '/*'): self.assertRegex(f, 'AAA[^B]+BBB.bak')