def test_base_title_10(self):
     # Test with matching suffix and number section in wrong location
     test_title = 'title (copy) (1)'
     title = get_base_title_with_suffix(test_title, '(copy)',
                                        '({count}) {title}')
     self.assertEqual(title, test_title)
 def test_base_title_8(self):
     # Test escaping of suffix
     test_title = 'title (copy) (1)'
     title = get_base_title_with_suffix(test_title, '(c?py)',
                                        '{title} ({count})')
     self.assertEqual(title, 'title (copy)')
 def test_base_title_9(self):
     # Test with matching suffix but no number section
     test_title = 'title (copy)'
     title = get_base_title_with_suffix(test_title, '(copy)',
                                        '({count}) {title}')
     self.assertEqual(title, 'title')
 def test_base_title_6(self):
     # Test with invalid number
     test_title = 'title (copy) (x)'
     title = get_base_title_with_suffix(test_title, '(copy)',
                                        '{title} ({count})')
     self.assertEqual(title, test_title)
 def test_base_title_7(self):
     # Test with extra character after number section
     test_title = 'title (copy) (1)x'
     title = get_base_title_with_suffix(test_title, '(copy)',
                                        '{title} ({count})')
     self.assertEqual(title, test_title)
 def test_base_title_5(self):
     # Test with missing number
     test_title = 'title (copy) ()'
     title = get_base_title_with_suffix(test_title, '(copy)',
                                        '{title} ({count})')
     self.assertEqual(title, 'title')
 def test_base_title_4(self):
     # Test with missing space between suffix and number section (and missing number)
     test_title = 'title (copy)()'
     title = get_base_title_with_suffix(test_title, '(copy)',
                                        '{title} ({count})')
     self.assertEqual(title, test_title)
 def test_base_title_2(self):
     # Test with matching suffix and number
     test_title = 'title (copy) (1)'
     title = get_base_title_with_suffix(test_title, '(copy)',
                                        '{title} ({count})')
     self.assertEqual(title, 'title')
 def test_base_title_0(self):
     # Test with no matching suffix
     test_title = 'title'
     title = get_base_title_with_suffix(test_title, '(copy)',
                                        '{title} ({count})')
     self.assertEqual(title, 'title')
Example #10
0
 def test_base_title_12(self):
     # Test with matching suffix and number section but with additional characters after suffix
     test_title = '(1) title (copy) (1)'
     title = get_base_title_with_suffix(test_title, '(copy)',
                                        '({count}) {title}')
     self.assertEqual(title, 'title (copy) (1)')