def test_present(self): """ Test to verify that the variable is in the ``make.conf`` and has the provided settings. """ name = "makeopts" ret = {"name": name, "result": True, "comment": "", "changes": {}} mock_t = MagicMock(return_value=True) with patch.dict(makeconf.__salt__, {"makeconf.get_var": mock_t}): comt = "Variable {0} is already present in make.conf".format(name) ret.update({"comment": comt}) self.assertDictEqual(makeconf.present(name), ret)
def test_present(self): ''' Test to verify that the variable is in the ``make.conf`` and has the provided settings. ''' name = 'makeopts' ret = {'name': name, 'result': True, 'comment': '', 'changes': {}} mock_t = MagicMock(return_value=True) with patch.dict(makeconf.__salt__, {'makeconf.get_var': mock_t}): comt = ( 'Variable {0} is already present in make.conf'.format(name)) ret.update({'comment': comt}) self.assertDictEqual(makeconf.present(name), ret)
def test_present(self): ''' Test to verify that the variable is in the ``make.conf`` and has the provided settings. ''' name = 'makeopts' ret = {'name': name, 'result': True, 'comment': '', 'changes': {}} mock_t = MagicMock(return_value=True) with patch.dict(makeconf.__salt__, {'makeconf.get_var': mock_t}): comt = ('Variable {0} is already present in make.conf'.format(name)) ret.update({'comment': comt}) self.assertDictEqual(makeconf.present(name), ret)