예제 #1
0
 def test_delegate_positive_realtime(self, MockPullReqState):
     state = MockPullReqState()
     action.delegate_positive(state, 'delegate', True)
     self.assertEqual(state.delegate, 'delegate')
     state.add_comment.assert_called_once_with(
         ':v: @delegate can now approve this pull request')
     state.save.assert_called_once_with()
예제 #2
0
 def test_delegate_positive_not_realtime(self, MockPullReqState):
     state = MockPullReqState()
     action.delegate_positive(state, 'delegate', False)
     self.assertEqual(state.delegate, 'delegate')
     state.save.assert_called_once_with()
     assert not state.add_comment.called, 'state.save was called and should never be.'