From e00c9215d9b6a8e544f4e16b471d0080c08ab019 Mon Sep 17 00:00:00 2001 From: Kaleemullah Siddiqui Date: Wed, 1 Nov 2023 22:16:16 +0530 Subject: [PATCH] fix: curate_auth func changed to non-async await call for _curate_auth_url missing in session creation which caused regression. function _curate_auth_url changed to non-async, tests updated to reflect the same Signed-off-by: Kaleemullah Siddiqui --- src/mrack/providers/openstack.py | 2 +- tests/unit/test_openstack.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/mrack/providers/openstack.py b/src/mrack/providers/openstack.py index 9a1a4dcb..daf7679b 100644 --- a/src/mrack/providers/openstack.py +++ b/src/mrack/providers/openstack.py @@ -121,7 +121,7 @@ async def _openstack_gather_responses(self, *calls): return result - async def _curate_auth_url(self, auth_url): + def _curate_auth_url(self, auth_url): """Append OpenStack API version if not present.""" return auth_url if auth_url.endswith("/v3") else auth_url + "/v3" diff --git a/tests/unit/test_openstack.py b/tests/unit/test_openstack.py index f2357d67..ffe75f28 100644 --- a/tests/unit/test_openstack.py +++ b/tests/unit/test_openstack.py @@ -898,8 +898,7 @@ async def test_create_session_from_clouds_yaml( ("http://example.com/openstack/v3", "http://example.com/openstack/v3"), ], ) - @pytest.mark.asyncio - async def test_curate_auth_url(self, input_auth_url, expected_auth_url): + def test_curate_auth_url(self, input_auth_url, expected_auth_url): provider = OpenStackProvider() - result_auth_url = await provider._curate_auth_url(input_auth_url) + result_auth_url = provider._curate_auth_url(input_auth_url) assert result_auth_url == expected_auth_url