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
6ed8598f
Commit
6ed8598f
authored
Jan 03, 2013
by
Alexander Kryklia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added soem tests
parent
cac564de
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
common/lib/capa/capa/graders/tests.py
+34
-0
No files found.
common/lib/capa/capa/graders/tests.py
View file @
6ed8598f
import
unittest
import
draganddrop
from
draganddrop
import
PositionsCompare
class
Test_PositionsCompare
(
unittest
.
TestCase
):
def
test_nested_list_and_list1
(
self
):
self
.
assertEqual
(
PositionsCompare
([[
1
,
2
],
40
]),
PositionsCompare
([
1
,
3
]))
def
test_nested_list_and_list2
(
self
):
self
.
assertNotEqual
(
PositionsCompare
([
1
,
12
]),
PositionsCompare
([
1
,
1
]))
def
test_list_and_list1
(
self
):
self
.
assertNotEqual
(
PositionsCompare
([[
1
,
2
],
12
]),
PositionsCompare
([
1
,
15
]))
def
test_list_and_list2
(
self
):
self
.
assertEqual
(
PositionsCompare
([
1
,
11
]),
PositionsCompare
([
1
,
1
]))
def
test_numerical_list_and_string_list
(
self
):
self
.
assertNotEqual
(
PositionsCompare
([
1
,
2
]),
PositionsCompare
([
"1"
]))
def
test_string_and_string_list1
(
self
):
self
.
assertEqual
(
PositionsCompare
(
"1"
),
PositionsCompare
([
"1"
]))
def
test_string_and_string_list2
(
self
):
self
.
assertEqual
(
PositionsCompare
(
"abc"
),
PositionsCompare
(
"abc"
))
def
test_string_and_string_list3
(
self
):
self
.
assertNotEqual
(
PositionsCompare
(
"abd"
),
PositionsCompare
(
"abe"
))
def
test_float_and_string
(
self
):
self
.
assertNotEqual
(
PositionsCompare
([
3.5
,
5.7
]),
PositionsCompare
([
"1"
]))
def
test_floats_and_ints
(
self
):
self
.
assertEqual
(
PositionsCompare
([
3.5
,
4.5
]),
PositionsCompare
([
5
,
7
]))
class
Test_DragAndDrop
(
unittest
.
TestCase
):
...
...
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