def test_select_race_print(self, mock_race, mock_output): expected = """Select a race: 1. Elf 2. Halfling 3. Tiefling 4. Dragonborn 5. Dwarf 6. Gnome 7. Half-Elf 8. Human 9. Half-Orc """ select_race() self.assertEqual(expected, mock_output.getvalue())
def test_select_race(self, mock_input): race_list = ['', 'dragonborn', 'dwarf', 'elf', 'gnome', 'half-elf', 'halfling', 'half-orc', 'human', 'tiefling'] for i in range(1, 9): my_race = dungeonsanddragons.select_race() self.assertEqual(my_race, race_list[i])
def test_select_race_halforc(self, mock_race, mock_output): expected = "half-orc" select_race() self.assertEqual(expected, select_race())
def test_select_race_human(self, mock_race, mock_output): expected = "human" select_race() self.assertEqual(expected, select_race())
def test_select_race_gnome(self, mock_race, mock_output): expected = "gnome" select_race() self.assertEqual(expected, select_race())
def test_select_race_dwarf(self, mock_race, mock_output): expected = "dwarf" select_race() self.assertEqual(expected, select_race())
def test_select_race_dragonborn(self, mock_race, mock_output): expected = "dragonborn" select_race() self.assertEqual(expected, select_race())
def test_select_race_tiefling(self, mock_race, mock_output): expected = "tiefling" select_race() self.assertEqual(expected, select_race())
def test_select_race(self, mock_input): self.assertEqual('dragonborn', select_race())