def test_feedback_not_enabled(p): set_cwd(tempfile.mkdtemp()) cuckoo_create() r = Feedback() r.set_path("tests/files/sample_analysis_storage") r.run({ "debug": { "errors": [ "a", "b", ], }, }) p.assert_not_called()
def test_feedback_enabled(p, q): set_cwd(tempfile.mkdtemp()) cuckoo_create() r = Feedback() r.set_path("tests/files/sample_analysis_storage") r.run({ "debug": { "errors": [ "a", "b", ], }, }) q.assert_called_once() p.return_value.send_feedback.assert_called_once()
def test_feedback_enabled(p, q): set_cwd(tempfile.mkdtemp()) cuckoo_create() faketask = {"id": 1} r = Feedback() r.set_path("tests/files/sample_analysis_storage") r.set_task(faketask) r.run({ "debug": { "errors": [ "a", "b", ], }, }) q.assert_called_once() p.return_value.send_feedback.assert_called_once()
def test_feedback_empty(): r = Feedback() r.set_path("tests/files/sample_analysis_storage") r.run({})