예제 #1
0
 def test_leave_suffix(self):
     filename = 'file.1'
     filenames = []
     filename_suffix = _suffix_number(filename, filenames)
     self.assertEqual(filename_suffix, 'file.1')
예제 #2
0
 def test_double_suffix(self):
     filename = 'file.1.0'
     filenames = ['file.1.0.gz']
     filename_suffix = _suffix_number(filename, filenames)
     self.assertEqual(filename_suffix, 'file.1.1')
예제 #3
0
 def test_num_between(self):
     filename = 'file'
     filenames = ['file.0.gz', 'file.2.gz']
     filename_suffix = _suffix_number(filename, filenames)
     self.assertEqual(filename_suffix, 'file.1')
예제 #4
0
 def test_inc_suffix_number(self):
     filename = 'file.0'
     filenames = ['file.0.gz', 'file.1.gz']
     filename_suffix = _suffix_number(filename, filenames)
     self.assertEqual(filename_suffix, 'file.2')
예제 #5
0
 def test_add_suffix_to_number(self):
     filename = 'file1'
     filenames = ['file1.gz']
     filename_suffix = _suffix_number(filename, filenames)
     self.assertEqual(filename_suffix, 'file1.0')
예제 #6
0
 def test_skip_two_nums(self):
     filename = 'file'
     filenames = ['file.0.gz', 'file.1.gz']
     filename_suffix = _suffix_number(filename, filenames)
     self.assertEqual(filename_suffix, 'file.2')
예제 #7
0
 def test_add_suffix(self):
     filename = 'file'
     filenames = []
     filename_suffix = _suffix_number(filename, filenames)
     self.assertEqual(filename_suffix, 'file.0')