Exemplo n.º 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()
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 4
0
 def testStartStage(self, set_stage):
   s = installer.StartStage([1], None)
   s.Run()
   set_stage.assert_called_with(1)
Exemplo n.º 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)