示例#1
0
 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)
示例#2
0
    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
示例#3
0
    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")
示例#4
0
 def test_empty_dest_must_raise(self):
     with pytest.raises(ValueError):
         jobs.DataStagingJobProfile("n", 1e6, "s", "")