def test_snapcraft_exception_reportable(self): exception = SnapcraftTException() exception._brief = "something's strange, in the neighborhood" exc_info = (snapcraft.internal.errors.SnapcraftException, exception, None) # Test default (is false). self.assertFalse(_is_reportable_error(exc_info)) # Test false. exception._reportable = False self.assertFalse(_is_reportable_error(exc_info)) # Test true. exception._reportable = True self.assertTrue(_is_reportable_error(exc_info))
def test_keyboard_interrupt(self): exc_info = (KeyboardInterrupt, KeyboardInterrupt(), None) self.assertFalse(_is_reportable_error(exc_info))