

@mock.patch.object(glance.api, 'glance')
def test_image_get_list_detailed(self, gc):
    kwargs = {
        'sort_dir': 'desc',
        'sort_key': 'namespace',
        'marker': 1,
        'paginate': False,
    }
    filters = {
        'name': 'fedora',
    }
    request = self.mock_rest_request(**{
        'GET': dict(kwargs, **filters),
    })
    gc.image_list_detailed.return_value = ([mock.Mock(**{
        'to_dict.return_value': {
            'name': 'fedora',
        },
    }), mock.Mock(**{
        'to_dict.return_value': {
            'name': 'cirros',
        },
    })], False, False)
    response = glance.Images().get(request)
    self.assertStatusCode(response, 200)
    self.assertEqual(response.json, {
        'items': [{
            'name': 'fedora',
        }, {
            'name': 'cirros',
        }],
        'has_more_data': False,
        'has_prev_data': False,
    })
    gc.image_list_detailed.assert_called_once_with(kwargs, filters=filters, **kwargs)

dataset/ETHPy150Open openstack/horizon/openstack_dashboard/test/api_tests/glance_rest_tests.py ImagesRestTestCase.test_image_get_list_detailed/VarMisuse@218/315 `request`->`kwargs`