def test_play_ds_with_include_role(): """ Test include_role command with poll""" adhoc_cli = AdHocCLI(args=['/bin/ansible', 'localhost', '-m', 'include_role']) adhoc_cli.parse() ret = adhoc_cli._play_ds('include_role', None, 2) assert ret['name'] == 'Ansible Ad-Hoc' assert ret['gather_facts'] == 'no'
def test_play_ds_positive(): """ Test _play_ds""" adhoc_cli = AdHocCLI(args=['/bin/ansible', 'localhost', '-m', 'command']) adhoc_cli.parse() ret = adhoc_cli._play_ds('command', 10, 2) assert ret['name'] == 'Ansible Ad-Hoc' assert ret['tasks'] == [{'action': {'module': 'command', 'args': {}}, 'async_val': 10, 'poll': 2, 'timeout': 0}]