Exemple #1
0
 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)
Exemple #2
0
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)
Exemple #3
0
 def test_generate_vowel_zero(self, mock_randint):
     actual = generate_name(0)
     expected = ''
     self.assertEqual(expected, actual)
Exemple #4
0
 def test_generate_vowel_positive(self, mock_randint):
     actual = generate_name(2)
     expected = 'Bedo'
     self.assertEqual(expected, actual)
Exemple #5
0
 def test_generate_vowel_one(self, mock_randint):
     actual = generate_name(1)
     expected = 'Be'
     self.assertEqual(expected, actual)
Exemple #6
0
 def test_generate_name_length(self):
     actual_value = generate_name(18)
     name_length = len(actual_value)
     self.assertTrue(name_length == 36)
Exemple #7
0
 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)