def test_reconfigure_jobs():
    """Should reconfigure with a list of jobs"""
    job1 = MagicMock()
    job1.name = "Job1"
    arc = AutoRegressionConfiguration()
    arc.add_job(job1)

    job2 = MagicMock()
    job2.name = "Job2"

    job3 = MagicMock()
    job3.name = "Job3"

    arc.reconfigure_jobs(jobs=[job2, job3])
    assert arc.get_num_jobs() == 2

    with pytest.raises(InvalidParameter):
        arc.get_job("Job1")

    assert arc.get_job("Job2") == job2
def test_get_job():
    """Should return the job expected"""
    arc = AutoRegressionConfiguration()
    job1 = MagicMock()
    job1.name = "Job1"
    arc.add_job(job1)

    job2 = MagicMock()
    job2.name = "Job2"
    arc.add_job(job2)

    job = arc.get_job("Job1")
    assert job == job1