Example #1
0
    def test_adding_dependencies(self):
        t = Task("task 0")
        t.dependency(TaskDependency("dep 0")).dependency(
            TaskDependency("dep 1")).dependency(TaskDependency("dep 2"))

        obj = t.to_map()
        assert 3 == len(obj["depends_on"])
        assert "dep 1" == obj["depends_on"][1]["name"]
Example #2
0
    def test_invalid_function(self):
        t = Task("task 0")

        with pytest.raises(TypeError):
            t.dependency(42)
Example #3
0
    def test_invalid_dependency(self):
        t = Task("task 0")

        with pytest.raises(TypeError):
            t.dependency("hello world")