def test_absent(self):
        name = 'github.com'
        user = 'root'

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

        with patch.object(os.path, 'isabs', MagicMock(return_value=False)):
            comt = ('If not specifying a "user", '
                    'specify an absolute "config".')
            ret.update({'comment': comt})
            self.assertDictEqual(ssh_known_hosts.absent(name), ret)

        mock = MagicMock(return_value=False)
        with patch.dict(ssh_known_hosts.__salt__,
                        {'ssh.get_known_host': mock}):
            comt = ('Host is already absent')
            ret.update({'comment': comt, 'result': True})
            self.assertDictEqual(ssh_known_hosts.absent(name, user), ret)

        mock = MagicMock(return_value=True)
        with patch.dict(ssh_known_hosts.__salt__,
                        {'ssh.get_known_host': mock}):
            with patch.dict(ssh_known_hosts.__opts__, {'test': True}):
                comt = ('Key for github.com is set to be'
                        ' removed from .ssh/known_hosts')
                ret.update({'comment': comt, 'result': None})
                self.assertDictEqual(ssh_known_hosts.absent(name, user), ret)

            with patch.dict(ssh_known_hosts.__opts__, {'test': False}):
                result = {'status': 'error', 'error': ''}
                mock = MagicMock(return_value=result)
                with patch.dict(ssh_known_hosts.__salt__,
                                {'ssh.rm_known_host': mock}):
                    ret.update({'comment': '', 'result': False})
                    self.assertDictEqual(ssh_known_hosts.absent(name, user),
                                         ret)

                result = {'status': 'removed', 'error': '',
                          'comment': 'removed'}
                mock = MagicMock(return_value=result)
                with patch.dict(ssh_known_hosts.__salt__,
                                {'ssh.rm_known_host': mock}):
                    ret.update({'comment': 'removed', 'result': True,
                                'changes': {'new': None, 'old': True}})
                    self.assertDictEqual(ssh_known_hosts.absent(name, user),
                                         ret)
Try and get a delivered message from the connection's message stack.
dataset/ETHPy150Open saltstack/salt/tests/unit/states/ssh_known_hosts_test.py/SshKnownHostsTestCase.test_absent--crossover with--dataset/ETHPy150Open gmr/rabbitpy/rabbitpy/channel.py/Channel._get_message