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)
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)
def test_default(self): value = 'tada' existing_labels = ['et', 'voila'] expected = 'tada' self.assertEqual(generate_label(value, existing_labels), expected)