예제 #1
0
 def testStartStageValidate(self):
   s = installer.StartStage('30', None)
   self.assertRaises(installer.ValidationError, s.Validate)
   s = installer.StartStage([1, 2, 3], None)
   self.assertRaises(installer.ValidationError, s.Validate)
   s = installer.StartStage(['30'], None)
   self.assertRaises(installer.ValidationError, s.Validate)
   s = installer.StartStage([30], None)
   s.Validate()
예제 #2
0
 def testStartStageException(self, set_stage):
   set_stage.side_effect = stage.Error('Test')
   ss = installer.StartStage([2], None)
   self.assertRaises(installer.ActionError, ss.Run)
예제 #3
0
 def testStartTerminalStage(self, exit_stage, set_stage):
     installer.StartStage([100, True], None).Run()
     set_stage.assert_called_with(100)
     exit_stage.assert_called_with(100)
예제 #4
0
 def testStartStage(self, set_stage):
   s = installer.StartStage([1], None)
   s.Run()
   set_stage.assert_called_with(1)
예제 #5
0
 def testStartNonTerminalStage(self, exit_stage, set_stage):
     installer.StartStage([50, False], None).Run()
     set_stage.assert_called_with(50)
     self.assertFalse(exit_stage.called)