예제 #1
0
 def test_submit_for_review(self, mock_submit_for_review):
     node = StepInst(name='hello')
     node.assignees = ['student']
     node.reviewers = ['teacher']
     node.status = STATUS.IN_PROGRESS
     node.trigger('student')
     mock_submit_for_review.assert_called_once()
예제 #2
0
 def test_in_progress_not_assignee(self):
     node = StepInst(name='hello')
     node.assignees = ['parent']
     node.reviewers = ['teacher']
     node.status = STATUS.IN_PROGRESS
     with self.assertRaises(CannotComplete):
         node.trigger('student')
예제 #3
0
 def test_complete(self, mock_complete):
     node = StepInst(name='hello')
     node.assignees = ['student']
     node.reviewers = ['teacher']
     node.status = STATUS.READY_FOR_REVIEW
     node.trigger('teacher')
     mock_complete.assert_called_once()
예제 #4
0
 def test_ready_for_review_not_reviewer(self):
     node = StepInst(name='hello')
     node.status = STATUS.READY_FOR_REVIEW
     node.reviewers = ['parent']
     with self.assertRaises(CannotComplete):
         node.trigger('teacher')
예제 #5
0
 def test_status_not_correct(self):
     node = StepInst(name='hello')
     node.assignees = ['student']
     node.reviewers = ['teacher']
     with self.assertRaises(CannotComplete):
         node.trigger('student')