def test_absent(self):
        name = 'frank'

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

        mock_t = MagicMock(return_value=True)
        mock = MagicMock(side_effect=[True, True, False])
        with patch.dict(postgres_database.__salt__,
                        {'postgres.db_exists': mock,
                         'postgres.db_remove': mock_t}):
            with patch.dict(postgres_database.__opts__, {'test': True}):
                comt = ('Database {0} is set to be removed'.format(name))
                ret.update({'comment': comt, 'result': None})
                self.assertDictEqual(postgres_database.absent(name), ret)

            with patch.dict(postgres_database.__opts__, {'test': False}):
                comt = ('Database {0} has been removed'.format(name))
                ret.update({'comment': comt, 'result': True,
                            'changes': {name: 'Absent'}})
                self.assertDictEqual(postgres_database.absent(name), ret)

                comt = ('Database {0} is not present, so it cannot be removed'
                        .format(name))
                ret.update({'comment': comt, 'result': True, 'changes': {}})
                self.assertDictEqual(postgres_database.absent(name), ret)
Call *func* with kwargs, but only those kwargs that it accepts.
dataset/ETHPy150Open saltstack/salt/tests/unit/states/postgres_database_test.py/PostgresDatabaseTestCase.test_absent--crossover with--dataset/ETHPy150Open ottogroup/palladium/palladium/util.py/apply_kwargs