Skip to content

Commit

Permalink
Fixes done based on errors raised by unit tests for user query
Browse files Browse the repository at this point in the history
  • Loading branch information
meoflynn committed Aug 1, 2023
1 parent 864d58f commit cb09196
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/openstack_query/queries/user_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -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},
}
}
)
Expand Down
3 changes: 2 additions & 1 deletion tests/lib/openstack_query/runners/test_user_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down

0 comments on commit cb09196

Please sign in to comment.