def test_present(self):
        name = 'virtual_host'

        ret = {'name': name,
               'changes': {'new': 'virtual_host', 'old': ''},
               'result': None,
               'comment': 'Virtual Host \'virtual_host\' will be created.'}

        mock = MagicMock(return_value=False)
        with patch.dict(rabbitmq_vhost.__salt__,
                        {'rabbitmq.vhost_exists': mock}):
            with patch.dict(rabbitmq_vhost.__opts__, {'test': True}):
                self.assertDictEqual(rabbitmq_vhost.present(name), ret)

    # 'absent' function tests: 1
Test to ensure the RabbitMQ VHost exists.
dataset/ETHPy150Open saltstack/salt/tests/unit/states/rabbitmq_vhost_test.py/RabbitmqVhostTestCase.test_present