Commit c30f5702 by Victor Shnayder

Move more tests around, start prep for inputtype refactor

parent 66604fd0
......@@ -124,8 +124,8 @@ def register_render_function(fn, names=None, cls=SimpleInput):
else:
raise NotImplementedError
def wrapped():
return fn
def wrapped(*args, **kwargs):
return fn(*args, **kwargs)
return wrapped
#-----------------------------------------------------------------------------
......@@ -146,12 +146,14 @@ def optioninput(element, value, status, render_template, msg=''):
raise Exception(
"[courseware.capa.inputtypes.optioninput] Missing options specification in "
+ etree.tostring(element))
# parse the set of possible options
oset = shlex.shlex(options[1:-1])
oset.quotes = "'"
oset.whitespace = ","
oset = [x[1:-1] for x in list(oset)]
# make ordered list with (key,value) same
# make ordered list with (key, value) same
osetdict = [(oset[x], oset[x]) for x in range(len(oset))]
# TODO: allow ordering to be randomized
......
......@@ -4,6 +4,8 @@ import os
from mock import Mock
TEST_DIR = os.path.dirname(os.path.realpath(__file__))
test_system = Mock(
ajax_url='courses/course_id/modx/a_location',
track_function=Mock(),
......@@ -11,7 +13,7 @@ test_system = Mock(
render_template=Mock(),
replace_urls=Mock(),
user=Mock(),
filestore=fs.osfs.OSFS(os.path.dirname(os.path.realpath(__file__))+"/test_files"),
filestore=fs.osfs.OSFS(os.path.join(TEST_DIR, "test_files")),
debug=True,
xqueue={'interface':None, 'callback_url':'/', 'default_queuename': 'testqueue', 'waittime': 10},
node_path=os.environ.get("NODE_PATH", "/usr/local/lib/node_modules"),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment