Пример #1
0
    def test_server_pxe(self):
        '''
        Tests to configure server to PXE perform a one off PXE boot
        '''
        mock = MagicMock(return_value=True)
        with patch.object(drac, '__execute_cmd', mock):
            self.assertTrue(drac.server_pxe())

        mock = MagicMock(side_effect=[True, False])
        with patch.object(drac, '__execute_cmd', mock):
            self.assertFalse(drac.server_pxe())

        mock = MagicMock(return_value=False)
        with patch.object(drac, '__execute_cmd', mock):
            self.assertFalse(drac.server_pxe())
Пример #2
0
    def test_server_pxe(self):
        '''
        Tests to configure server to PXE perform a one off PXE boot
        '''
        mock = MagicMock(return_value=True)
        with patch.object(drac, '__execute_cmd', mock):
            self.assertTrue(drac.server_pxe())

        mock = MagicMock(side_effect=[True, False])
        with patch.object(drac, '__execute_cmd', mock):
            self.assertFalse(drac.server_pxe())

        mock = MagicMock(return_value=False)
        with patch.object(drac, '__execute_cmd', mock):
            self.assertFalse(drac.server_pxe())