Пример #1
0
 def test_validate_task_no_tasks(self):
     result = run.validate_tasks({})
     assert result == []
Пример #2
0
 def test_validate_tasks_valid(self):
     expected = {"foo": "bar"}
     result = run.validate_tasks({"tasks": expected})
     assert result == expected
Пример #3
0
 def test_validate_tasks_invalid(self):
     config = {"tasks": {"kernel": "can't be here"}}
     with pytest.raises(AssertionError):
         run.validate_tasks(config)
Пример #4
0
 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")
Пример #5
0
 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")
Пример #6
0
 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")
Пример #7
0
 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")