def test_set(self):
        name = 'nullmailer'
        data = {'shared/mailname': {'type': 'string',
                                    'value': 'server.domain.tld'},
                'nullmailer/relayhost': {'type': 'string',
                                         'value': 'mail.domain.tld'}}

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

        changes = {'nullmailer/relayhost': 'New value: mail.domain.tld',
                   'shared/mailname': 'New value: server.domain.tld'}

        mock = MagicMock(return_value=None)
        with patch.dict(debconfmod.__salt__, {'debconf.show': mock}):
            with patch.dict(debconfmod.__opts__, {'test': True}):
                ret.update({'changes': changes})
                self.assertDictEqual(debconfmod.set(name, data), ret)
Test to set debconf selections
dataset/ETHPy150Open saltstack/salt/tests/unit/states/debconfmod_test.py/DebconfmodTestCase.test_set