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
5c588812
Commit
5c588812
authored
Jan 04, 2013
by
Alexander Kryklia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests for drag and drop
parent
01e4bdb8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
9 deletions
+42
-9
common/lib/capa/capa/graders/tests.py
+42
-9
No files found.
common/lib/capa/capa/graders/tests.py
View file @
5c588812
...
...
@@ -222,20 +222,53 @@ class Test_DragAndDrop_Populate(unittest.TestCase):
class
Test_DraAndDrop_Compare_Positions
(
unittest
.
TestCase
):
def
test_exact_1
(
self
):
self
.
assertTrue
(
1
)
def
test_1
(
self
):
dnd
=
draganddrop
.
DragAndDrop
()
self
.
assertTrue
(
dnd
.
compare_positions
(
correct
=
[[
1
,
1
],
[
2
,
3
]],
user
=
[[
2
,
3
],
[
1
,
1
]],
flag
=
'anyof'
))
def
test_2a
(
self
):
dnd
=
draganddrop
.
DragAndDrop
()
self
.
assertTrue
(
dnd
.
compare_positions
(
correct
=
[[
1
,
1
],
[
2
,
3
]],
user
=
[[
2
,
3
],
[
1
,
1
]],
flag
=
'exact'
))
def
test_exact_2
(
self
):
self
.
assertTrue
(
1
)
def
test_2b
(
self
):
dnd
=
draganddrop
.
DragAndDrop
()
self
.
assertFalse
(
dnd
.
compare_positions
(
correct
=
[[
1
,
1
],
[
2
,
3
]],
user
=
[[
2
,
13
],
[
1
,
1
]],
flag
=
'exact'
))
def
test_anyof_1
(
self
):
self
.
assertTrue
(
1
)
def
test_3
(
self
):
dnd
=
draganddrop
.
DragAndDrop
()
self
.
assertFalse
(
dnd
.
compare_positions
(
correct
=
[
"a"
,
"b"
],
user
=
[
"a"
,
"b"
,
"c"
],
flag
=
'anyof'
))
def
test_anyof_2
(
self
):
self
.
assertTrue
(
1
)
def
test_4
(
self
):
dnd
=
draganddrop
.
DragAndDrop
()
self
.
assertTrue
(
dnd
.
compare_positions
(
correct
=
[
"a"
,
"b"
,
"c"
],
user
=
[
"a"
,
"b"
],
flag
=
'anyof'
))
def
test_5
(
self
):
self
.
assertTrue
(
1
)
dnd
=
draganddrop
.
DragAndDrop
()
self
.
assertFalse
(
dnd
.
compare_positions
(
correct
=
[
"a"
,
"b"
,
"c"
],
user
=
[
"a"
,
"c"
,
"b"
],
flag
=
'exact'
))
def
test_6
(
self
):
dnd
=
draganddrop
.
DragAndDrop
()
self
.
assertTrue
(
dnd
.
compare_positions
(
correct
=
[
"a"
,
"b"
,
"c"
],
user
=
[
"a"
,
"c"
,
"b"
],
flag
=
'anyof'
))
def
test_7
(
self
):
dnd
=
draganddrop
.
DragAndDrop
()
self
.
assertFalse
(
dnd
.
compare_positions
(
correct
=
[
"a"
,
"b"
,
"b"
],
user
=
[
"a"
,
"c"
,
"b"
],
flag
=
'anyof'
))
def
suite
():
...
...
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