Exemple #1
0
    def test_nameservers(self):
        """
        tests for configure the nameservers on the DRAC
        """
        self.assertFalse(drac.nameservers("a", "b", "c"))

        mock = MagicMock(return_value=False)
        with patch.object(drac, "__execute_cmd", mock):
            self.assertFalse(drac.nameservers("a"))

        mock = MagicMock(return_value=True)
        with patch.object(drac, "__execute_cmd", mock):
            self.assertTrue(drac.nameservers("a"))
Exemple #2
0
    def test_nameservers(self):
        '''
        tests for configure the nameservers on the DRAC
        '''
        self.assertFalse(drac.nameservers('a', 'b', 'c'))

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

        mock = MagicMock(return_value=True)
        with patch.object(drac, '__execute_cmd', mock):
            self.assertTrue(drac.nameservers('a'))
Exemple #3
0
    def test_nameservers(self):
        '''
        tests for configure the nameservers on the DRAC
        '''
        self.assertFalse(drac.nameservers('a', 'b', 'c'))

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

        mock = MagicMock(return_value=True)
        with patch.object(drac, '__execute_cmd', mock):
            self.assertTrue(drac.nameservers('a'))