def test_present(self):
        name = 'frank'

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

        mock = MagicMock(return_value={})
        with patch.dict(postgres_extension.__salt__,
                        {'postgres.create_metadata': mock}):
            with patch.dict(postgres_extension.__opts__, {'test': True}):
                comt = ('Extension {0} is set to be created'.format(name))
                ret.update({'comment': comt, 'result': None})
                self.assertDictEqual(postgres_extension.present(name), ret)

            with patch.dict(postgres_extension.__opts__, {'test': False}):
                comt = ('Extension {0} is already present'.format(name))
                ret.update({'comment': comt, 'result': True})
                self.assertDictEqual(postgres_extension.present(name), ret)

    # 'absent' function tests: 1
Adds an option to the spec
dataset/ETHPy150Open saltstack/salt/tests/unit/states/postgres_extension_test.py/PostgresExtensionTestCase.test_present--crossover with--dataset/ETHPy150Open JohnMaguire/Cardinal/cardinal/config.py/ConfigSpec.add_option