Пример #1
0
 def test_three_duplicates(self):
     value = 'tada'
     existing_labels = ['et', 'voila', 'tada', 'tada-1', 'tada-2']
     expected = 'tada-3'
     self.assertEqual(generate_label(value, existing_labels), expected)
Пример #2
0
 def test_invalid_chars_with_duplicates(self):
     value = 'tada??'
     existing_labels = ['et', 'voila', 'tada', 'tada-1']
     expected = 'tada-2'
     self.assertEqual(generate_label(value, existing_labels), expected)
Пример #3
0
 def test_default(self):
     value = 'tada'
     existing_labels = ['et', 'voila']
     expected = 'tada'
     self.assertEqual(generate_label(value, existing_labels), expected)