Пример #1
0
    def test_absent(self):
        """
        Test to verify that the variable is not in the ``make.conf``.
        """
        name = "makeopts"

        ret = {"name": name, "result": True, "comment": "", "changes": {}}

        mock = MagicMock(return_value=None)
        with patch.dict(makeconf.__salt__, {"makeconf.get_var": mock}):
            comt = "Variable {0} is already absent from make.conf".format(name)
            ret.update({"comment": comt})
            self.assertDictEqual(makeconf.absent(name), ret)
Пример #2
0
    def test_absent(self):
        '''
        Test to verify that the variable is not in the ``make.conf``.
        '''
        name = 'makeopts'

        ret = {'name': name, 'result': True, 'comment': '', 'changes': {}}

        mock = MagicMock(return_value=None)
        with patch.dict(makeconf.__salt__, {'makeconf.get_var': mock}):
            comt = (
                'Variable {0} is already absent from make.conf'.format(name))
            ret.update({'comment': comt})
            self.assertDictEqual(makeconf.absent(name), ret)
Пример #3
0
    def test_absent(self):
        '''
        Test to verify that the variable is not in the ``make.conf``.
        '''
        name = 'makeopts'

        ret = {'name': name,
               'result': True,
               'comment': '',
               'changes': {}}

        mock = MagicMock(return_value=None)
        with patch.dict(makeconf.__salt__, {'makeconf.get_var': mock}):
            comt = ('Variable {0} is already absent from make.conf'
                    .format(name))
            ret.update({'comment': comt})
            self.assertDictEqual(makeconf.absent(name), ret)