示例#1
0
    def test_append_error(self):
        feedback = CuckooFeedbackObject(message="test")
        feedback.add_error("test")

        obj = feedback.to_dict()
        assert obj["message"] == "test"
        assert obj["errors"] == ["test"]
示例#2
0
    def run(self, results):
        # Nothing to see here.
        if not results.get("debug", {}).get("errors"):
            return

        feedback = CuckooFeedback()
        if not feedback.enabled():
            return

        fo = CuckooFeedbackObject(
            message="One or more errors occurred during an analysis",
            automated=True)

        for error in results["debug"]["errors"]:
            fo.add_error(error)

        fo.gather_export_files(self.analysis_path)
        feedback.send_feedback(fo)