Example #1
0
    def test_allocate_when_unavailable_must_raise(self):
        m = {"n": 0}
        s = Storage(0, "0", True, m)
        s._set_unavailable()
        with pytest.raises(RuntimeError) as excinfo:
            s._allocate("job")

        assert "unavailable" in str(excinfo.value)
Example #2
0
 def test_set_available(self):
     s = Storage(0, "0")
     s._set_unavailable()
     s._set_available()
     assert not s.is_unavailable
Example #3
0
 def test_set_unavailable_when_already_allocated_must_not_raise(self):
     m = {"n": 0}
     s = Storage(0, "0", True, m)
     s._allocate("job")
     s._set_unavailable()
     assert s.is_unavailable and s.jobs
Example #4
0
 def test_is_unavailable(self):
     m = {"n": 0}
     s = Storage(0, "0", True, m)
     s._set_unavailable()
     assert s.is_unavailable