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()
def testStartStageException(self, set_stage): set_stage.side_effect = stage.Error('Test') ss = installer.StartStage([2], None) self.assertRaises(installer.ActionError, ss.Run)
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)
def testStartStage(self, set_stage): s = installer.StartStage([1], None) s.Run() set_stage.assert_called_with(1)
def testStartNonTerminalStage(self, exit_stage, set_stage): installer.StartStage([50, False], None).Run() set_stage.assert_called_with(50) self.assertFalse(exit_stage.called)