Commit ad0a7d30 by Alexander Kryklia

tests and test plan

parent e2104820
...@@ -37,7 +37,7 @@ class Test_PositionsCompare(unittest.TestCase): ...@@ -37,7 +37,7 @@ class Test_PositionsCompare(unittest.TestCase):
self.assertEqual(PositionsCompare([3.5, 4.5]), PositionsCompare([5, 7])) self.assertEqual(PositionsCompare([3.5, 4.5]), PositionsCompare([5, 7]))
class Test_DragAndDrop(unittest.TestCase): class Test_DragAndDrop_Grade(unittest.TestCase):
def test_targets_true(self): def test_targets_true(self):
user_input = '{"use_targets": true, "draggables": [{"1": "t1"}, \ user_input = '{"use_targets": true, "draggables": [{"1": "t1"}, \
...@@ -136,7 +136,7 @@ class Test_DragAndDrop(unittest.TestCase): ...@@ -136,7 +136,7 @@ class Test_DragAndDrop(unittest.TestCase):
], ],
'rule': 'anyof' 'rule': 'anyof'
}, { }, {
'draggables': ['7','8', '9', '10'], 'draggables': ['7', '8', '9', '10'],
'targets': ['p_left_1', 'p_left_2', 'p_right_1','p_right_2'], 'targets': ['p_left_1', 'p_left_2', 'p_right_1','p_right_2'],
'rule': 'anyof' 'rule': 'anyof'
}, { }, {
...@@ -175,7 +175,7 @@ class Test_DragAndDrop(unittest.TestCase): ...@@ -175,7 +175,7 @@ class Test_DragAndDrop(unittest.TestCase):
], ],
'rule': 'anyof' 'rule': 'anyof'
}, { }, {
'draggables': ['7','8', '9', '10'], 'draggables': ['7', '8', '9', '10'],
'targets': ['p_left_1', 'p_left_2', 'p_right_1','p_right_2'], 'targets': ['p_left_1', 'p_left_2', 'p_right_1','p_right_2'],
'rule': 'anyof' 'rule': 'anyof'
}, { }, {
...@@ -199,14 +199,37 @@ class Test_DragAndDrop(unittest.TestCase): ...@@ -199,14 +199,37 @@ class Test_DragAndDrop(unittest.TestCase):
self.assertFalse(draganddrop.grade(user_input, correct_answer)) self.assertFalse(draganddrop.grade(user_input, correct_answer))
class Test_DragAndDrop_Populate(unittest.TestCase):
#test for every function in DND #test for every function in DND
# test for different denied-allowed positions inised def test1(self):
# different groups self.assertTrue(1)
class Test_DraAndDrop_Compare_Positions(unittest.TestCase):
def test_exact_1(self):
self.assertTrue(1)
def test_exact_2(self):
self.assertTrue(1)
def test_anyof_1(self):
self.assertTrue(1)
def test_anyof_2(self):
self.assertTrue(1)
def test_5(self):
self.assertTrue(1)
def suite(): def suite():
testcases = [Test_DragAndDrop] testcases = [Test_PositionsCompare,
Test_DragAndDrop_Populate,
Test_DragAndDrop_Grade,
Test_DraAndDrop_Compare_Positions]
suites = [] suites = []
for testcase in testcases: for testcase in testcases:
suites.append(unittest.TestLoader().loadTestsFromTestCase(testcase)) suites.append(unittest.TestLoader().loadTestsFromTestCase(testcase))
......
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