roll up of eos fixes (#21629)

* fixes error where eos would close the cli shell
* fixes network_cli connection plugin to check before calling open_shell()
* fixes json commands being sent over eapi
This commit is contained in:
Peter Sprygada 2017-02-19 08:46:14 -05:00 committed by GitHub
parent 76c9ad9dfc
commit d5f7a0181b
4 changed files with 23 additions and 19 deletions

View file

@ -45,7 +45,6 @@ class TestConnectionClass(unittest.TestCase):
conn.ssh = None
self.assertRaises(AnsibleConnectionFailure, conn._connect)
#mocked_terminal_loader.all.assert_called_with(class_only=True)
mocked_terminal_loader.reset_mock()
mocked_terminal_loader.get.return_value = None
@ -139,6 +138,7 @@ class TestConnectionClass(unittest.TestCase):
conn._shell = MagicMock()
# test _shell already open
conn._connected = MagicMock(return_value=True)
rc, out, err = conn.exec_command('command')
self.assertEqual(out, 'command response')
self.assertFalse(mock_open_shell.called)