Exemplo n.º 1
0
 def test_set_priority_not_priority_more_than_max_priority(
         self, MockPullReqState):
     state = MockPullReqState()
     state.priority = 2
     self.assertFalse(
         action.set_priority(state, True, '5', {'max_priority': 3}))
     self.assertEqual(state.priority, 2)
     state.add_comment.assert_called_once_with(
         ':stop_sign: Priority higher than 3 is ignored.')
     assert not state.save.called, 'state.save was called and should never be.'
Exemplo n.º 2
0
 def test_set_priority_not_priority_less_than_max_priority(
         self, MockPullReqState):
     state = MockPullReqState()
     action.set_priority(state, True, '1', {'max_priority': 3})
     self.assertEqual(state.priority, 1)
     state.save.assert_called_once_with()