def test_function_symbolic(self):
     total_range = self.kernel_session.function(wl.Composition(wl.Total, wl.Range))
     self.assertEqual(total_range(5), 15)
from __future__ import absolute_import, print_function, unicode_literals

import logging
import os

from aiohttp import web
from wolframclient.evaluation import WolframEvaluatorPool, WolframLanguageAsyncSession
from wolframclient.language import wl
from wolframclient.utils.functional import last

from wolframwebengine.server.explorer import get_wl_handler_path_from_folder
from wolframwebengine.web import aiohttp_wl_view

EXTENSIONS = {
    ".wxf": wl.Composition(wl.BinaryDeserialize, wl.ReadByteArray),
    ".mx": wl.Function(wl.Import(wl.Slot(), "MX")),
    ".m": wl.Get,
    ".wl": wl.Get,
}


def is_wl_code(path):
    try:
        return bool(get_wl_handler(path))
    except KeyError:
        return False


def get_wl_handler(path):
    return EXTENSIONS[last(os.path.splitext(path)).lower()]