Skip to content

Commit 7dcf729

Browse files
committed
test(BA-5827): expect AppConfigFragmentNotFound on Fragment update missing key
Mirrors the Policy-side test fix on BA-5814: the repository now raises rather than returning `None` for an unresolved natural key, so flip the assertion accordingly.
1 parent a210e76 commit 7dcf729

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

tests/unit/manager/repositories/app_config_fragment/test_app_config_fragment.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
AppConfigFragmentKey,
1111
AppConfigScopeType,
1212
)
13-
from ai.backend.manager.errors.app_config import AppConfigFragmentPolicyMissing
13+
from ai.backend.manager.errors.app_config import (
14+
AppConfigFragmentNotFound,
15+
AppConfigFragmentPolicyMissing,
16+
)
1417
from ai.backend.manager.models.app_config_fragment.row import AppConfigFragmentRow
1518
from ai.backend.manager.models.app_config_policy.row import AppConfigPolicyRow
1619
from ai.backend.manager.models.utils import ExtendedAsyncSAEngine
@@ -172,11 +175,11 @@ async def test_update_replaces_extra_config(
172175
assert updated.extra_config is not None
173176
assert dict(updated.extra_config) == {"color": "red", "density": "compact"}
174177

175-
async def test_update_returns_none_for_missing_key(
178+
async def test_update_raises_for_missing_key(
176179
self,
177180
admin_repository: AppConfigFragmentAdminRepository,
178181
) -> None:
179-
assert (
182+
with pytest.raises(AppConfigFragmentNotFound):
180183
await admin_repository.update(
181184
key=AppConfigFragmentKey(
182185
scope_type=AppConfigScopeType.DOMAIN,
@@ -185,8 +188,6 @@ async def test_update_returns_none_for_missing_key(
185188
),
186189
extra_config={"color": "blue"},
187190
)
188-
is None
189-
)
190191

191192
async def test_purge_existing_fragment_returns_true(
192193
self,

0 commit comments

Comments
 (0)