From cb091965deca29d0c6c0aa6a99de198cc6a85633 Mon Sep 17 00:00:00 2001 From: meoflynn <68336207+meoflynn@users.noreply.github.com> Date: Tue, 1 Aug 2023 13:47:17 +0100 Subject: [PATCH] Fixes done based on errors raised by unit tests for user query --- lib/openstack_query/queries/user_query.py | 4 ++-- tests/lib/openstack_query/runners/test_user_runner.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/openstack_query/queries/user_query.py b/lib/openstack_query/queries/user_query.py index 741c12199..efb6d8289 100644 --- a/lib/openstack_query/queries/user_query.py +++ b/lib/openstack_query/queries/user_query.py @@ -56,8 +56,8 @@ def _get_server_side_handler(self) -> ServerSideHandler: return ServerSideHandler( { QueryPresetsGeneric.EQUAL_TO: { - UserProperties.DOMAIN_ID: lambda value: {"domain_id": value}, - UserProperties.NAME: lambda value: {"name": value}, + UserProperties.USER_DOMAIN_ID: lambda value: {"domain_id": value}, + UserProperties.USER_NAME: lambda value: {"name": value}, } } ) diff --git a/tests/lib/openstack_query/runners/test_user_runner.py b/tests/lib/openstack_query/runners/test_user_runner.py index 2178857f6..cf390bb1b 100644 --- a/tests/lib/openstack_query/runners/test_user_runner.py +++ b/tests/lib/openstack_query/runners/test_user_runner.py @@ -47,9 +47,10 @@ def test_run_query(self, _, mock_filter_kwargs): "user2", "user3", ] + mock_user = self.conn.identity.v3.users res = self.instance._run_query(self.conn, filter_kwargs=mock_filter_kwargs) self.assertEqual(res, mock_user_list) - mock_user_list.assert_called_once_with(**mock_filter_kwargs) + mock_user.assert_called_once_with(**mock_filter_kwargs) def test_parse_subset(self): """