def test_allocate_staging_job_with_missing_src_mapping_must_raise(self): prof = jobs.DataStagingJobProfile("p", 1, "a", "b") alloc = [1] j = jobs.Job("1", "w", 1, prof, 0) j._submit(0) with pytest.raises(ValueError) as excinfo: j._allocate(alloc, {"b": 1}) assert "a" in str(excinfo.value)
def test_valid_instance(self): name, nb_bytes = "n", 15e6 src, dest = "src", "dest" p = jobs.DataStagingJobProfile(name, nb_bytes, src, dest) assert p.nb_bytes == nb_bytes assert p.src == src assert p.dest == dest assert p.name == name
def test_nb_bytes_not_greater_than_zero_must_raise(self): with pytest.raises(ValueError): jobs.DataStagingJobProfile("n", -1e6, "s", "d") with pytest.raises(ValueError): jobs.DataStagingJobProfile("n", 0, "s", "d")
def test_empty_dest_must_raise(self): with pytest.raises(ValueError): jobs.DataStagingJobProfile("n", 1e6, "s", "")