예제 #1
0
파일: test_mass.py 프로젝트: sornars/mass
 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]')
예제 #2
0
 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]')
예제 #3
0
 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')
예제 #4
0
파일: test_mass.py 프로젝트: sornars/mass
 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')