address pkg mgm failure is not longer set status to failed

This commit is contained in:
John Feng 2024-09-09 12:34:35 -07:00 коммит произвёл LiliDeng
Родитель 4df06f0f7f
Коммит a1358de514
1 изменённых файлов: 10 добавлений и 3 удалений

Просмотреть файл

@ -106,12 +106,16 @@ def _assert_status_file_result(
if error_details_not_empty
else False
)
ua_esm_required_code = (
_verify_details_code(status_file, "UA_ESM_REQUIRED")
if error_details_not_empty
else False
)
package_manager_failure_code = (
_verify_details_code(status_file, "PACKAGE_MANAGER_FAILURE")
if error_details_not_empty
else False
)
if truncated_package_code:
assert_that(status_file["status"]).described_as(
@ -145,7 +149,10 @@ def _assert_status_file_result(
assert_that(error_code).described_as(
"Expected 1 error in status file patches operation"
).is_equal_to("1")
elif package_manager_failure_code:
assert_that(status_file["status"]).described_as(
expected_succeeded_status_msg
).is_equal_to("Succeeded")
else:
assert_that(status_file["status"]).described_as(
expected_succeeded_status_msg
@ -158,7 +165,7 @@ def _assert_status_file_result(
def _verify_details_code(status_file: Any, code: str) -> bool:
return any(
code in detail_code["code"]
code.upper() in detail_code["code"].upper()
for detail_code in status_file["error"]["details"]
if "code" in detail_code
)