Esempio n. 1
0
 def testStartStageException(self, set_stage):
   set_stage.side_effect = stage.Error('Test')
   ss = installer.StartStage([2], None)
   self.assertRaises(installer.ActionError, ss.Run)
Esempio n. 2
0
 def test_get_status_expired(self, active, expiration, start_end):
     active.return_value = 5
     start_end.return_value = (datetime.datetime.now(), None)
     expiration.side_effect = stage.Error('Expired')
     self.assertEqual(stage.get_status(), 'Expired')
     self.assertTrue(expiration.called)