def test_generate_name_consonant(self): consonant = [ 'b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'z' ] actual_value = generate_name(10) self.assertTrue(actual_value[4] in consonant)
def main(): """ Call all functions to run the program. """ inventory = ['Longsword', 'Dagger', 'Bow', 'Staff', 'Wand', 'Shield', 'Spear', 'Axe', 'Hammer'] print("I am now rolling a 3d6 ---> You rolled", roll_die(3, 6)) print("I am now generating two random inventory items for you ---> ", choose_inventory(inventory, 2)) print("I am now generating your name ---> Hello", generate_name(4)) print("I am now creating a random character for you ---> ", create_character(8)) print("\n..... Here is your character info below .....") character = create_character(8) character.append(choose_inventory(inventory, 3)) print_character(character)
def test_generate_vowel_zero(self, mock_randint): actual = generate_name(0) expected = '' self.assertEqual(expected, actual)
def test_generate_vowel_positive(self, mock_randint): actual = generate_name(2) expected = 'Bedo' self.assertEqual(expected, actual)
def test_generate_vowel_one(self, mock_randint): actual = generate_name(1) expected = 'Be' self.assertEqual(expected, actual)
def test_generate_name_length(self): actual_value = generate_name(18) name_length = len(actual_value) self.assertTrue(name_length == 36)
def test_generate_name_vowel(self): vowel = ['a', 'e', 'i', 'o', 'u', 'y'] actual_value = generate_name(10) self.assertTrue(actual_value[0] in vowel)