def test_store_error_summary_duplicate(activate_responses, test_repository,
                                       test_job):
    log_url = 'http://my-log.mozilla.org'
    log_obj = JobLog.objects.create(job=test_job,
                                    name="errorsummary_json",
                                    url=log_url)

    write_failure_lines(log_obj, [{
        "action": "log",
        "level": "debug",
        "message": "test",
        "line": 1
    }])
    write_failure_lines(
        log_obj,
        [
            {
                "action": "log",
                "level": "debug",
                "message": "test",
                "line": 1
            },
            {
                "action": "log",
                "level": "debug",
                "message": "test 1",
                "line": 2
            },
        ],
    )

    assert FailureLine.objects.count() == 2
def test_store_error_summary_duplicate(activate_responses, test_repository, jm,
                                       eleven_jobs_stored):
    log_url = 'http://my-log.mozilla.org'
    job = Job.objects.get(guid=jm.get_job(1)[0]['job_guid'])
    log_obj = JobLog.objects.create(job=job,
                                    name="errorsummary_json",
                                    url=log_url)

    write_failure_lines(test_repository, job.guid, log_obj, [{
        "action": "log",
        "level": "debug",
        "message": "test",
        "line": 1
    }])
    write_failure_lines(test_repository, job.guid, log_obj, [{
        "action": "log",
        "level": "debug",
        "message": "test",
        "line": 1
    }, {
        "action": "log",
        "level": "debug",
        "message": "test 1",
        "line": 2
    }])

    assert FailureLine.objects.count() == 2
def test_store_error_summary_duplicate(activate_responses, test_repository, test_job):
    log_url = 'http://my-log.mozilla.org'
    log_obj = JobLog.objects.create(job=test_job, name="errorsummary_json", url=log_url)

    write_failure_lines(log_obj, [{"action": "log",
                                   "level": "debug",
                                   "message": "test",
                                   "line": 1}])
    write_failure_lines(log_obj, [{"action": "log",
                                   "level": "debug",
                                   "message": "test",
                                   "line": 1},
                                  {"action": "log",
                                   "level": "debug",
                                   "message": "test 1",
                                   "line": 2}])

    assert FailureLine.objects.count() == 2
def test_store_error_summary_duplicate(activate_responses, test_repository, jm, eleven_jobs_stored):
    log_url = 'http://my-log.mozilla.org'
    job = Job.objects.get(guid=jm.get_job(1)[0]['job_guid'])
    log_obj = JobLog.objects.create(job=job, name="errorsummary_json", url=log_url)

    write_failure_lines(test_repository, job.guid, log_obj, [{"action": "log",
                                                              "level": "debug",
                                                              "message": "test",
                                                              "line": 1}])
    write_failure_lines(test_repository, job.guid, log_obj, [{"action": "log",
                                                              "level": "debug",
                                                              "message": "test",
                                                              "line": 1},
                                                             {"action": "log",
                                                              "level": "debug",
                                                              "message": "test 1",
                                                              "line": 2}])

    assert FailureLine.objects.count() == 2