def test_hardcoded_tasks(self, doit_app): output = StringIO() cmd = TabCompletion(task_loader=FakeLoader(), outstream=output) cmd.doit_app = doit_app cmd.execute({'shell': 'zsh', 'hardcode_tasks': True}, []) got = output.getvalue() assert 't1' in got
def test_cmds_with_params(self, doit_app): output = StringIO() cmd = TabCompletion(task_loader=DodoTaskLoader(), outstream=output) cmd.doit_app = doit_app cmd.execute({'shell': 'zsh', 'hardcode_tasks': False}, []) got = output.getvalue() assert "tabcompletion: generate script" in got
def test_hardcoded_tasks(self, doit_app): output = StringIO() cmd = TabCompletion(task_loader=FakeLoader(), outstream=output) cmd.doit_app = doit_app cmd.execute({'shell':'zsh', 'hardcode_tasks': True}, []) got = output.getvalue() assert 't1' in got
def test_cmds_with_params(self, doit_app): output = StringIO() cmd = TabCompletion(task_loader=DodoTaskLoader(), outstream=output) cmd.doit_app = doit_app cmd.execute({'shell':'zsh', 'hardcode_tasks': False}, []) got = output.getvalue() assert "tabcompletion: generate script" in got
def test_with_dodo__dinamic_tasks(self, doit_app): output = StringIO() cmd = TabCompletion(task_loader=DodoTaskLoader(), outstream=output) cmd.doit_app = doit_app cmd.execute({'shell': 'bash', 'hardcode_tasks': False}, []) got = output.getvalue() assert 'dodof' in got assert 't1' not in got assert 'tabcompletion' in got
def test_with_dodo__dinamic_tasks(self, doit_app): output = StringIO() cmd = TabCompletion(task_loader=DodoTaskLoader(), outstream=output) cmd.doit_app = doit_app cmd.execute({'shell':'bash', 'hardcode_tasks': False}, []) got = output.getvalue() assert 'dodof' in got assert 't1' not in got assert 'tabcompletion' in got
def test_cmd_takes_file_args(self, doit_app): output = StringIO() cmd = TabCompletion(task_loader=FakeLoader(), outstream=output) cmd.doit_app = doit_app cmd.execute({'shell': 'bash', 'hardcode_tasks': False}, []) got = output.getvalue() assert """help) COMPREPLY=( $(compgen -W "${tasks} ${sub_cmds}" -- $cur) ) return 0""" in got assert """tabcompletion) COMPREPLY=( $(compgen -f -- $cur) ) return 0""" in got
def test_cmd_takes_file_args(self, doit_app): output = StringIO() cmd = TabCompletion(task_loader=FakeLoader(), outstream=output) cmd.doit_app = doit_app cmd.execute({'shell':'bash', 'hardcode_tasks': False}, []) got = output.getvalue() assert """help) COMPREPLY=( $(compgen -W "${tasks} ${sub_cmds}" -- $cur) ) return 0""" in got assert """tabcompletion) COMPREPLY=( $(compgen -f -- $cur) ) return 0""" in got