def parse_untargetable_command(user_input, player): command = user_input[0] if command in Constants.DIRECTIONS[0]: return Commands.parse_move_command(user_input, player) if command in Constants.HELP: return Commands.parse_help_command() if command in Constants.LOOK: return Commands.parse_look_command(player) if command in Constants.QUIT: return Commands.parse_quit_command() if command in Constants.INVENTORY: return Commands.parse_inventory_command(player) # If the command is in the targeted commands like 'examine' or 'give', tell the player this. if is_command_valid( user_input, Constants.SINGLE_TARGET_COMMANDS + Constants.DOUBLE_TARGET_COMMANDS): return Constants.IMPROPERLY_TARGETED_COMMAND return Constants.INVALID_COMMAND_GIVEN_STRING
def test_look_command(self): player = copy.copy(Test_Objects.TEST_PLAYER) actual = Commands.parse_look_command(player) self.assertEqual(player.location.desc, actual)