def test_adding_commands(self): t = Task("task 0") t.commands([CmdGetProject().resolve(), CmdGetProject().resolve()]) obj = t.to_map() assert 2 == len(obj["commands"]) assert "git.get_project" == obj["commands"][0]["command"]
def test_invalid_commands(self): t = Task("task 0") with pytest.raises(TypeError): t.commands("hello world")