From cbb13b89a2ee2ab904bc1ddf665eeb78a84f163b Mon Sep 17 00:00:00 2001 From: CleverThis Date: Mon, 4 May 2026 23:22:18 +0000 Subject: [PATCH] fix(acms): assert on last_remove_result in hot tier remove step Update the then-step for removing entries from the hot storage tier to assert on context.last_remove_result (set by the when-step) instead of calling remove() a second time. The double-removal caused the assertion to always fail because the entry was already gone. Also update the feature file scenarios to use the when-step before the then-step. ISSUES CLOSED: #9972 --- features/acms_hot_storage_tier.feature | 2 ++ features/steps/acms_hot_storage_tier_steps.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/features/acms_hot_storage_tier.feature b/features/acms_hot_storage_tier.feature index 3a7aac988..b1849d075 100644 --- a/features/acms_hot_storage_tier.feature +++ b/features/acms_hot_storage_tier.feature @@ -191,10 +191,12 @@ Feature: ACMS Hot Storage Tier (in-memory LRU cache) Scenario: Remove returns the content of the removed entry Given a HotStorageTier with no capacity limits When I put entry "r2" with content "my-content" + And I remove "r2" from the hot tier Then removing "r2" from the hot tier should return "my-content" Scenario: Remove returns None for missing entry Given a HotStorageTier with no capacity limits + When I remove "nonexistent" from the hot tier Then removing "nonexistent" from the hot tier should return None Scenario: Remove updates size_bytes correctly diff --git a/features/steps/acms_hot_storage_tier_steps.py b/features/steps/acms_hot_storage_tier_steps.py index c16abae11..bf05bfc99 100644 --- a/features/steps/acms_hot_storage_tier_steps.py +++ b/features/steps/acms_hot_storage_tier_steps.py @@ -126,13 +126,13 @@ def step_when_remove_entry(context: Any, entry_id: str) -> None: @then('removing "{entry_id}" from the hot tier should return "{expected}"') def step_then_remove_returns(context: Any, entry_id: str, expected: str) -> None: - result = context.hot_tier.remove(entry_id) + result = context.last_remove_result assert result == expected, f"Expected {expected!r}, got {result!r}" @then('removing "{entry_id}" from the hot tier should return None') def step_then_remove_returns_none(context: Any, entry_id: str) -> None: - result = context.hot_tier.remove(entry_id) + result = context.last_remove_result assert result is None, f"Expected None, got {result!r}"