Beispiel #1
0
    def test_process_submission_callback(self, mock_psm):
        message = {
            "challenge_pk": self.challenge.pk,
            "phase_pk": self.challenge_phase.pk,
            "submission_pk": self.submission.pk
        }
        body = json.dumps(message)

        submission_worker.process_submission_callback(body)
        mock_psm.assert_called_with(message)
Beispiel #2
0
    def test_process_submission_callback_with_exception(
            self, mock_psm, mock_logger):
        message = {
            "challenge_pk": self.challenge.pk,
            "phase_pk": self.challenge_phase.pk,
            "submission_pk": self.submission.pk,
        }
        body = json.dumps(message)

        mock_psm.side_effect = Exception("test error")

        submission_worker.process_submission_callback(body)

        mock_logger.assert_called_with(
            "Exception while receiving message from submission queue with error test error"
        )