def test_success_suppression(self): clear_report() contextualize_report('a=0\na') verify() tifa_analysis() set_success() suppress(label='set_success') final = simple.resolve() self.assertEqual(Feedback.CATEGORIES.COMPLETE, final.category) self.assertEqual(SUCCESS_MESSAGE, final.title+"\n"+final.message)
def test_analyzer_suppression(self): clear_report() contextualize_report('1+"Hello"') verify() tifa_analysis() commands.run() suppress("analyzer") final = simple.resolve() self.assertEqual("runtime", final.category) self.assertEqual("Type Error", final.title)
def test_runtime_suppression(self): clear_report() contextualize_report('import json\njson.loads("0")+"1"') verify() tifa_analysis() commands.run() suppress("Runtime") final = simple.resolve() self.assertEqual(Feedback.CATEGORIES.COMPLETE, final.category) self.assertEqual(SUCCESS_TEXT, final.message)
def __exit__(self, *args): suppress("runtime", "FileNotFoundError", report=self.report) self.final = simple.resolve() self.feedback = """{title}\n{message}""".format( title=self.final.title, message=self.final.message)