def test_generate_name_len(self): syllables = 10 expected = 20 self.assertEqual(expected, len(generate_name(syllables)))
def test_generate_name_3(self, mock_letter): syllables = 3 expected = "Badehi" self.assertEqual(expected, generate_name(syllables))
def test_generate_name_title_case(self): syllables = 5 name = generate_name(syllables) self.assertEqual(name, name.title())
def test_vowels(self): for i in range(1, len(generate_name(4)), 2): # every odd letter should be a vowel self.assertIn((generate_name(4))[i], 'aeiouy')
def test_length(self): self.assertEqual(6, len(generate_name(3)))
def test_consonants(self): for i in range(0, len(generate_name(4)), 2): # every even letter should be a consonant self.assertIn((generate_name(4))[i], 'bcdfghjklmnpqrstvwxyz')