def test_send_config(self): """ Test netmiko.send_config function """ _, ret = netmiko_mod.send_config(config_commands=["ls", "echo hello world"]) self.assertEqual(ret.get("config_commands"), ["ls", "echo hello world"]) self.assertEqual(ret.get("user"), "salt") self.assertEqual(ret.get("password"), "password")
def test_send_config(self): """ Test netmiko.send_config function """ _, ret = netmiko_mod.send_config( config_commands=["ls", "echo hello world"], config_mode_command="config config-sess", ) self.assertEqual(ret.get("config_commands"), ["ls", "echo hello world"]) self.assertEqual(ret.get("config_mode_command"), "config config-sess")
def test_send_config(self): """ Test netmiko.send_config function """ _, ret = netmiko_mod.send_config( config_commands=["ls", "echo hello world"], config_mode_command="config config-sess", ) self.assertEqual(ret.get("config_commands"), ["ls", "echo hello world"]) self.assertEqual(ret.get("config_mode_command"), "config config-sess") with patch.dict( netmiko_mod.__proxy__, {"netmiko.conn": MagicMock(return_value=None)} ): _, ret = netmiko_mod.send_config( config_commands=["ls", "echo hello world"], config_mode_command="config config-sess", ) self.assertEqual(ret.get("config_commands"), ["ls", "echo hello world"]) self.assertEqual(ret.get("config_mode_command"), "config config-sess")