From: Zack Cerza Date: Fri, 21 Aug 2015 16:56:42 +0000 (-0600) Subject: test_execute_playbook(): patch Remote.reconnect() X-Git-Tag: 1.1.0~841^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F601%2Fhead;p=teuthology.git test_execute_playbook(): patch Remote.reconnect() Speeds up that unit test greatly. Signed-off-by: Zack Cerza --- diff --git a/teuthology/test/task/test_ansible.py b/teuthology/test/task/test_ansible.py index 2cf8902d6..005529ded 100644 --- a/teuthology/test/task/test_ansible.py +++ b/teuthology/test/task/test_ansible.py @@ -257,7 +257,9 @@ class TestAnsibleTask(TestTask): logger = StringIO() with patch.object(ansible.pexpect, 'run') as m_run: m_run.return_value = ('', 0) - task.execute_playbook(_logfile=logger) + with patch.object(Remote, 'reconnect') as m_reconnect: + m_reconnect.return_value = True + task.execute_playbook(_logfile=logger) m_run.assert_called_once_with( ' '.join(args), logfile=logger,