@patch('salt.cloud.clouds.opennebula.list_nodes',
           MagicMock(return_value={'test-vm': {'id': '100'}}))
    def test_get_vm_id_success(self):
        mock_id = '100'
        mock_kwargs = {'name': 'test-vm'}
        self.assertEqual(opennebula.get_vm_id(mock_kwargs, 'foo'),
                         mock_id)
Tests that the function returns successfully.
dataset/ETHPy150Open saltstack/salt/tests/unit/cloud/clouds/opennebula_test.py/OpenNebulaTestCase.test_get_vm_id_success