Exemplo n.º 1
0
 def testWarnValidate(self):
     warn = abort.Warn('abort message', None)
     self.assertRaises(abort.ValidationError, warn.Validate)
     warn = abort.Warn([1, 2, 3], None)
     self.assertRaises(abort.ValidationError, warn.Validate)
     warn = abort.Warn([1], None)
     self.assertRaises(abort.ValidationError, warn.Validate)
     warn = abort.Warn(['Error Message'], None)
     warn.Validate()
Exemplo n.º 2
0
 def testWarn(self, prompt, build_info):
     warn = abort.Warn(['warning message'], build_info)
     prompt.return_value = None
     self.assertRaises(abort.ActionError, warn.Run)
     prompt.return_value = 'no thanks'
     self.assertRaises(abort.ActionError, warn.Run)
     prompt.return_value = 'Y'
     warn.Run()