def test_validate_task_no_tasks(self): result = run.validate_tasks({}) assert result == []
def test_validate_tasks_valid(self): expected = {"foo": "bar"} result = run.validate_tasks({"tasks": expected}) assert result == expected
def test_validate_tasks_invalid(self): config = {"tasks": {"kernel": "can't be here"}} with pytest.raises(AssertionError): run.validate_tasks(config)
def test_validate_tasks_is_list(self): with pytest.raises(AssertionError) as excinfo: run.validate_tasks({"tasks": {"foo": "bar"}}) assert excinfo.value.message.startswith("Expected list")
def test_validate_tasks_invalid(self): config = {"tasks": [{"kernel": "can't be here"}]} with pytest.raises(AssertionError) as excinfo: run.validate_tasks(config) assert excinfo.value.message.startswith("kernel installation")