예제 #1
0
def test_remove_existing_jobs_single_existing(test_repository, failure_classifications,
                                              sample_data, sample_push,
                                              mock_log_parser):
    """Remove single existing job prior to loading"""

    job_data = sample_data.job_data[:1]
    test_utils.do_job_ingestion(test_repository, job_data, sample_push)
    assert Job.objects.count() == 1

    data = _remove_existing_jobs(job_data)
    assert data == []
예제 #2
0
def test_remove_existing_jobs_single_existing(test_repository, failure_classifications,
                                              sample_data, sample_push,
                                              mock_log_parser):
    """Remove single existing job prior to loading"""

    job_data = sample_data.job_data[:1]
    test_utils.do_job_ingestion(test_repository, job_data, sample_push)
    assert Job.objects.count() == 1

    data = _remove_existing_jobs(job_data)
    assert len(data) == 0
def test_remove_existing_jobs_one_existing_one_new(test_repository, failure_classifications,
                                                   sample_data,
                                                   sample_resultset,
                                                   mock_log_parser):
    """Remove single existing job prior to loading"""

    job_data = sample_data.job_data[:1]
    test_utils.do_job_ingestion(test_repository, job_data, sample_resultset)

    data = _remove_existing_jobs(sample_data.job_data[:2])

    assert len(data) == 1
    assert Job.objects.count() == 1
예제 #4
0
def test_remove_existing_jobs_one_existing_one_new(test_repository,
                                                   failure_classifications,
                                                   sample_data,
                                                   sample_resultset,
                                                   mock_log_parser):
    """Remove single existing job prior to loading"""

    job_data = sample_data.job_data[:1]
    test_utils.do_job_ingestion(test_repository, job_data, sample_resultset)

    data = _remove_existing_jobs(sample_data.job_data[:2])

    assert len(data) == 1
    assert Job.objects.count() == 1