コード例 #1
0
 def test_class_selection_global_third(self, mock_user_input):
     """Assert that class selection is updated in character global variable."""
     class_selection()
     self.assertEqual(pokemon, {'Name': 'Dave', 'Class': 'Bulbasaur\n', 'Position': [0, 0], 'HP': 10})
コード例 #2
0
 def test_class_selection_error(self, mock_user_input):
     """Assert an AttributeError with an int."""
     with self.assertRaises(AttributeError):
         class_selection()
コード例 #3
0
 def test_class_selection(self, mock_stdout, mock_user_input):
     """Assert incorrect output message based on user input."""
     expected_output = "Please enter a number to choose your Pokemon type!\n"
     class_selection()
     self.assertEqual(mock_stdout.getvalue(), expected_output)
コード例 #4
0
 def test_class_selection_global_first(self, mock_user_input):
     """Assert that class selection is updated in global variable."""
     class_selection()
     self.assertEqual(pokemon, {'Name': 'Dave', 'Class': 'Squirtle', 'Position': [0, 0], 'HP': 10})
コード例 #5
0
 def test_error_class_selection(self, mock_choose_inventory):
     self.assertEqual(class_selection(), None)
コード例 #6
0
 def test_first_class_selection(self, mock_choose_inventory):
     expected_output = 'Bounty Hunter'
     self.assertEqual(class_selection(), expected_output)
コード例 #7
0
 def test_seventh_class_selection(self, mock_choose_inventory):
     expected_output = 'Smuggler'
     self.assertEqual(class_selection(), expected_output)
コード例 #8
0
 def test_eighth_class_selection(self, mock_choose_inventory):
     expected_output = 'Trooper'
     self.assertEqual(class_selection(), expected_output)
コード例 #9
0
 def test_sixth_class_selection(self, mock_choose_inventory):
     expected_output = 'Sith Inquisitor'
     self.assertEqual(class_selection(), expected_output)
コード例 #10
0
 def test_fifth_class_selection(self, mock_choose_inventory):
     expected_output = 'Sith Warrior'
     self.assertEqual(class_selection(), expected_output)
コード例 #11
0
 def test_fourth_class_selection(self, mock_choose_inventory):
     expected_output = 'Jedi Knight'
     self.assertEqual(class_selection(), expected_output)
コード例 #12
0
 def test_third_class_selection(self, mock_choose_inventory):
     expected_output = 'Jedi Consular'
     self.assertEqual(class_selection(), expected_output)
コード例 #13
0
 def test_second_class_selection(self, mock_choose_inventory):
     expected_output = 'Imperial Agent'
     self.assertEqual(class_selection(), expected_output)