def setUp(self): # Setup logging for the class self.logger = logging.getLogger(type(self).__name__) self.logger.debug("setUp") # Create test character self.char = game_system.Character(name='One')
def setUp(self): # Setup logging for the class self.logger = logging.getLogger(type(self).__name__) self.logger.debug("setUp") # Create test character self.char = game_system.Character(name='Two') # NOTE: This is overriding the character class item check method to allow the rest of the functionality to be # tested. self.char._check_item_type = self._check_item_type
def test_create_with_name_value(self): self.logger.debug("test_create_with_name_value") char = game_system.Character(name='One') self.logger.debug("Character: %s", char) self.assertEqual(char.name, 'One')
def test_create_without_values(self): self.logger.debug("test_create_without_values") char = game_system.Character() self.logger.debug("Character: %s", char) self.assertEqual(char.name, '')