def test_set_unavailable_must_return_to_last_state(self): h = Host(0, "n") h._allocate("job") h._start_computing() h._set_unavailable() assert h.is_unavailable and not h.is_computing h._set_available() assert h.is_computing and not h.is_unavailable
def test_set_available_without_being_unavailable_must_raise(self): h = Host(0, "n") with pytest.raises(SystemError) as excinfo: h._set_available() assert "unavailable" in str(excinfo.value)
def test_set_available(self): h = Host(0, "n") h._set_unavailable() h._set_available() assert not h.is_unavailable