def test_main_exec(listen_wapp): with mock.log(): with mock.utils(cfg, tag='exec'): with listen_wapp(profile='exec'): rc = _exec.main(['tdata/listen/exec/exec.task']) assert rc == 0
def test_main_no_task_file(listen_wapp): with mock.log(): with mock.utils(cfg, tag='no_task_file'): with listen_wapp(profile='exec'): rc = _exec.main(['no.task.file']) assert rc == 2
def test_main_no_action_args(listen_wapp): with mock.log(): with mock.utils(cfg, tag='no_action_args'): with listen_wapp(profile='exec'): rc = _exec.main(['tdata/listen/exec/no_action_args.task']) assert rc == 5
def test_main_no_args(listen_wapp): with mock.log(): with mock.utils(None): with listen_wapp(profile='exec') as wapp: rc = _exec.main([]) assert rc == 1