Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
87d135a4
Commit
87d135a4
authored
Sep 19, 2014
by
Usman Khalid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added tests for unparsable matlab grader response.
TNL-388
parent
10bd2b00
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
common/lib/capa/capa/tests/test_inputtypes.py
+29
-0
No files found.
common/lib/capa/capa/tests/test_inputtypes.py
View file @
87d135a4
...
...
@@ -26,6 +26,7 @@ import xml.sax.saxutils as saxutils
from
.
import
test_capa_system
from
capa
import
inputtypes
from
capa.checker
import
DemoSystem
from
mock
import
ANY
,
patch
from
pyparsing
import
ParseException
...
...
@@ -727,6 +728,34 @@ class MatlabTest(unittest.TestCase):
received
=
fromstring
(
context
[
'queue_msg'
])
html_tree_equal
(
received
,
expected
)
def
test_rendering_with_invalid_queue_msg
(
self
):
self
.
the_input
.
queue_msg
=
(
u"<div class='matlabResponse'><div style='white-space:pre' class='commandWindowOutput'>"
u"
\n
ans =
\n\n\u0002\n\n
</div><ul></ul></div>"
)
context
=
self
.
the_input
.
_get_render_context
()
# pylint: disable=protected-access
self
.
maxDiff
=
None
expected
=
{
'STATIC_URL'
:
'/dummy-static/'
,
'id'
:
'prob_1_2'
,
'value'
:
'print "good evening"'
,
'status'
:
inputtypes
.
Status
(
'queued'
),
'msg'
:
self
.
the_input
.
submitted_msg
,
'mode'
:
self
.
mode
,
'rows'
:
self
.
rows
,
'cols'
:
self
.
cols
,
'queue_msg'
:
"<span>Error running code.</span>"
,
'linenumbers'
:
'true'
,
'hidden'
:
''
,
'tabsize'
:
int
(
self
.
tabsize
),
'button_enabled'
:
True
,
'queue_len'
:
'3'
,
'matlab_editor_js'
:
'/dummy-static/js/vendor/CodeMirror/octave.js'
,
}
self
.
assertEqual
(
context
,
expected
)
self
.
the_input
.
capa_system
.
render_template
=
DemoSystem
()
.
render_template
self
.
the_input
.
get_html
()
# Should not raise an exception
def
test_matlab_queue_message_allowed_tags
(
self
):
"""
Test allowed tags.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment