@skipIf(not HAS_WIN32NET_MODS, 'this test needs the w32net library')
    def test_poweroff(self):
        mock = MagicMock(return_value='salt')
        with patch.object(win_system, 'shutdown', mock):
            self.assertEqual(win_system.poweroff(), 'salt')
Test to poweroff a running system
dataset/ETHPy150Open saltstack/salt/tests/unit/modules/win_system_test.py/WinSystemTestCase.test_poweroff