def test_allocate_pfs_job_without_mapping_must_raise(self): prof = jobs.ParallelHomogeneousPFSJobProfile("p", 10, 20, "a") alloc = [1] j = jobs.Job("1", "w", 1, prof, 0) j._submit(0) with pytest.raises(ValueError) as excinfo: j._allocate(alloc) assert "mapping" in str(excinfo.value)
def test_valid_instance(self): r = 5e6 w = 10e6 name = "n" storage = "s1" p = jobs.ParallelHomogeneousPFSJobProfile(name, r, w, storage) assert p.bytes_to_read == r assert p.bytes_to_write == w assert p.storage == storage assert p.name == name
def test_empty_storage_must_raise(self): with pytest.raises(ValueError): jobs.ParallelHomogeneousPFSJobProfile("n", 1, 1, "")
def test_negative_bytes_to_read_must_raise(self): with pytest.raises(ValueError): jobs.ParallelHomogeneousPFSJobProfile("n", -1, 1, "pfs")
def test_zero_bytes_to_write_and_read_must_raise(self): with pytest.raises(ValueError): jobs.ParallelHomogeneousPFSJobProfile("n", 0, 0, "pfs")
def test_zero_bytes_to_write_must_be_valid(self): p = jobs.ParallelHomogeneousPFSJobProfile("n", 1, 0, "pfs") assert p.bytes_to_write == 0