Ejemplo n.º 1
0
def test_setters():
    job = Job('storageA', 'storageB', '~/.data/', [True, True, True], user)

    timestamp = datetime.datetime.now()
    job.set_start_time(timestamp)
    job.set_end_time(timestamp)
    job.set_enqueue_time(timestamp)
    assert job.get_start_time() == timestamp
    assert job.get_end_time() == timestamp
    assert job.get_enqueue_time() == timestamp

    job.set_status(JobStatus.DONE)
    assert job.get_status() == JobStatus.DONE
    assert job.has_start_notification() == job.has_start_notification()
    assert job.has_end_notification() == job.has_end_notification()
    assert job.has_error_notification() == job.has_error_notification()
Ejemplo n.º 2
0
def test_getters():
    job = Job('storageA', 'storageB', '~/.data/', [True, True, True], user)
    another_job = Job.get_job_by_id(job.get_job_id())
    assert another_job.get_job_id() == job.get_job_id()
    assert another_job.get_source_alias() == job.get_source_alias()
    assert another_job.get_target_alias() == job.get_target_alias()
    assert another_job.get_source_relative_path(
    ) == job.get_source_relative_path()
    assert another_job.get_start_time() == job.get_start_time()
    assert another_job.get_end_time() == job.get_end_time()
    assert another_job.get_enqueue_time() == job.get_enqueue_time()
    assert another_job.get_status() == job.get_status()
    assert another_job.has_start_notification() == job.has_start_notification()
    assert another_job.has_end_notification() == job.has_end_notification()
    assert another_job.has_error_notification() == job.has_error_notification()
    assert another_job.get_user().get_username() == job.get_user(
    ).get_username()