Skip to content

Commit

Permalink
One additional line of code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
kjohn-msft committed Nov 6, 2024
1 parent 58865be commit 7f2b3c2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/core/src/core_logic/ExecutionConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def __get_max_patch_publish_date_from_inclusions(self, included_package_name_mas
continue

if candidate != str() or not included_package_name_mask_list[i].startswith("MaxPatchPublishDate="):
continue
continue # good candidate already found, or candidate not found and

candidate = included_package_name_mask_list[i].replace("MaxPatchPublishDate=", "")
candidate_split = candidate.split("T")
Expand Down
4 changes: 2 additions & 2 deletions src/core/tests/Test_AptitudePackageManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,11 +597,11 @@ def test_maxpatchpublishdate_mitigation_mode(self):
# classic happy path mode
argument_composer = ArgumentComposer()
argument_composer.classifications_to_include = [Constants.PackageClassification.CRITICAL]
argument_composer.patches_to_include = ["AzGPS_Mitigation_Mode_No_SLA", "MaxPatchPublishDate=20250101T010203Z"]
argument_composer.patches_to_include = ["AzGPS_Mitigation_Mode_No_SLA", "MaxPatchPublishDate=20250101T010203Z", "*kernel*"]
self.runtime = RuntimeCompositor(argument_composer.get_composed_arguments(), True, Constants.APT)
execution_config = self.runtime.container.get('execution_config')
self.assertEqual(execution_config.max_patch_publish_date, "20250101T010203Z")
self.assertEqual(len(execution_config.included_package_name_mask_list), 0) # inclusion list is sanitized
self.assertEqual(len(execution_config.included_package_name_mask_list), 1) # inclusion list is sanitized
self.runtime.stop()

# retains valid inclusions while honoring mitigation mode entries
Expand Down

0 comments on commit 7f2b3c2

Please sign in to comment.