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()
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()