From dfeb1697a5523f28a1869b6d6e7b094a69c13dbe Mon Sep 17 00:00:00 2001 From: chidanandpujar Date: Mon, 14 Oct 2024 19:12:44 +0530 Subject: [PATCH] pull requests for issue #1322 #1315 --- tests/unit/utils/test_sw.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/unit/utils/test_sw.py b/tests/unit/utils/test_sw.py index ad6cc773b..2796d8a4c 100644 --- a/tests/unit/utils/test_sw.py +++ b/tests/unit/utils/test_sw.py @@ -242,12 +242,36 @@ def test_sw_install_issu(self, mock_execute): package = "test.tgz" self.assertTrue(self.sw.install(package, issu=True, no_copy=True)) + @patch("jnpr.junos.Device.execute") + def test_sw_install_issu_validate_False(self, mock_execute): + mock_execute.side_effect = self._mock_manager + package = "test.tgz" + self.assertTrue(self.sw.install(package, issu=True, no_copy=True, validate=False)) + + @patch("jnpr.junos.Device.execute") + def test_sw_install_issu_validate_True(self, mock_execute): + mock_execute.side_effect = self._mock_manager + package = "test.tgz" + self.assertTrue(self.sw.install(package, issu=True, no_copy=True, validate=True)) + @patch("jnpr.junos.Device.execute") def test_sw_install_nssu(self, mock_execute): mock_execute.side_effect = self._mock_manager package = "test.tgz" self.assertTrue(self.sw.install(package, nssu=True, no_copy=True)) + @patch("jnpr.junos.Device.execute") + def test_sw_install_nssu_validate_False(self, mock_execute): + mock_execute.side_effect = self._mock_manager + package = "test.tgz" + self.assertTrue(self.sw.install(package, nssu=True, no_copy=True, validate=False)) + + @patch("jnpr.junos.Device.execute") + def test_sw_install_nssu_validate_True(self, mock_execute): + mock_execute.side_effect = self._mock_manager + package = "test.tgz" + self.assertTrue(self.sw.install(package, nssu=True, no_copy=True, validate=True)) + @patch("jnpr.junos.Device.execute") def test_sw_install_issu_nssu_both_error(self, mock_execute): mock_execute.side_effect = self._mock_manager