From cc277681f4bb97a51205c5fbdf0946be842f9c6c Mon Sep 17 00:00:00 2001 From: Ryan K Date: Tue, 14 Jan 2025 16:22:18 -0800 Subject: [PATCH] fix(test): only check initial prefix for missing/extra resource names (#477) --- azext_edge/tests/helpers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/azext_edge/tests/helpers.py b/azext_edge/tests/helpers.py index eff559685..19a3bf755 100644 --- a/azext_edge/tests/helpers.py +++ b/azext_edge/tests/helpers.py @@ -51,8 +51,9 @@ def find_extra_or_missing_names( ignore_missing: bool = False, ): error_msg = [] - # expected_names might contains descriptor, if so, remove it + # names may contain descriptors after the initial '.', just comparing first prefix expected_names = [name.split(".")[0] for name in expected_names] + result_names = [name.split(".")[0] for name in result_names] extra_names = [name for name in result_names if name not in expected_names] if extra_names: msg = f"Extra {resource_type} names: {', '.join(extra_names)}."