def test_reboot(self): ''' Test to reboot the system using the 'reboot' command ''' with patch.dict(system.__salt__, {'cmd.run': MagicMock(return_value='A')}): self.assertEqual(system.reboot(), 'A')
def test_reboot(self): ''' Test to reboot the system with shutdown -r ''' self.assertEqual(system.reboot(), 'A') system.__salt__['cmd.run'].assert_called_with( ['shutdown', '-r', 'now'], python_shell=False)
def test_reboot_with_delay(self): ''' Test to reboot the system using shutdown -r with a delay ''' self.assertEqual(system.reboot(at_time=5), 'A') system.__salt__['cmd.run'].assert_called_with(['shutdown', '-r', '5'], python_shell=False)
def test_reboot_with_delay(self): ''' Test to reboot the system using shutdown -r with a delay ''' self.assertEqual(system.reboot(at_time=5), 'A') system.__salt__['cmd.run'].assert_called_with( ['shutdown', '-r', '5'], python_shell=False)
def test_reboot_with_delay(self): """ Test to reboot the system using shutdown -r with a delay """ cmd_mock = MagicMock(return_value="A") with patch.dict(system.__salt__, {"cmd.run": cmd_mock}): self.assertEqual(system.reboot(at_time=5), "A") cmd_mock.assert_called_with(["shutdown", "-r", "5"], python_shell=False)
def test_reboot(self): """ Test to reboot the system with shutdown -r """ cmd_mock = MagicMock(return_value="A") with patch.dict(system.__salt__, {"cmd.run": cmd_mock}): self.assertEqual(system.reboot(), "A") cmd_mock.assert_called_with(["shutdown", "-r", "now"], python_shell=False)
def test_reboot_with_delay(self): ''' Test to reboot the system using shutdown -r with a delay ''' cmd_mock = MagicMock(return_value='A') with patch.dict(system.__salt__, {'cmd.run': cmd_mock}): self.assertEqual(system.reboot(at_time=5), 'A') cmd_mock.assert_called_with(['shutdown', '-r', '5'], python_shell=False)
def test_reboot(self): ''' Test to reboot the system with shutdown -r ''' cmd_mock = MagicMock(return_value='A') with patch.dict(system.__salt__, {'cmd.run': cmd_mock}): self.assertEqual(system.reboot(), 'A') cmd_mock.assert_called_with(['shutdown', '-r', 'now'], python_shell=False)