Skip to content

Commit f01dc10

Browse files
committed
test(k8s): fix stale k8s_errors imports + registry rename after rebase
Rebasing #287 onto main surfaced: inline imports still used the pre-rename orb.providers.k8s.exceptions.k8s_errors path (main renamed the module to k8s_exceptions); and CLISpecRegistry test used the old _specs attribute (main renamed to _store). Correct both so the rebased branch is green.
1 parent ba0e476 commit f01dc10

3 files changed

Lines changed: 12 additions & 15 deletions

File tree

tests/providers/k8s/unit/handlers/test_statefulset_handler.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
from orb.domain.request.value_objects import RequestId, RequestType
3232
from orb.domain.template.template_aggregate import Template
3333
from orb.providers.k8s.configuration.config import K8sProviderConfig
34-
from orb.providers.k8s.exceptions.k8s_exceptions import K8sError
3534
from orb.providers.k8s.infrastructure.handlers.statefulset_handler import K8sStatefulSetHandler
3635

3736
# ---------------------------------------------------------------------------
@@ -258,8 +257,7 @@ async def test_release_hosts_selective_non_highest_ordinal_raises_and_does_not_s
258257
``test_statefulset_release_reject.py`` for the guard function's own
259258
unit coverage.
260259
"""
261-
from orb.providers.k8s.exceptions.k8s_errors import K8sError
262-
260+
from orb.providers.k8s.exceptions.k8s_exceptions import K8sError
263261

264262
core_v1 = MagicMock()
265263
apps_v1 = MagicMock()
@@ -290,8 +288,7 @@ async def test_release_hosts_selective_unparseable_victim_names_raises() -> None
290288
"""Victim names that do not parse as ``<statefulset>-<ordinal>`` are
291289
treated as non-top-of-stack and therefore refused, since the
292290
controller cannot guarantee they will be the ones evicted."""
293-
from orb.providers.k8s.exceptions.k8s_errors import K8sError
294-
291+
from orb.providers.k8s.exceptions.k8s_exceptions import K8sError
295292

296293
core_v1 = MagicMock()
297294
apps_v1 = MagicMock()

tests/providers/k8s/unit/test_coverage_gaps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ async def test_job_release_refuses_selective_release() -> None:
498498
module ``test_job_release_reject.py`` for direct guard-function
499499
coverage.
500500
"""
501-
from orb.providers.k8s.exceptions.k8s_errors import K8sError
501+
from orb.providers.k8s.exceptions.k8s_exceptions import K8sError
502502
from orb.providers.k8s.infrastructure.handlers.job_handler import K8sJobHandler
503503

504504
batch_v1 = MagicMock()

tests/unit/cli/test_common_args.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,11 @@ def test_new_provider_reflected_when_registry_is_expanded(self):
109109
"""Simulates a new provider type being registered before build time."""
110110
from orb.infrastructure.registry.cli_spec_registry import CLISpecRegistry
111111

112-
original_specs = dict(CLISpecRegistry._specs)
112+
original_specs = dict(CLISpecRegistry._store)
113113
try:
114114
# Install a fake spec so the registry returns an extra type.
115115
fake_spec = object()
116-
CLISpecRegistry._specs["fake-provider"] = fake_spec # type: ignore[assignment]
116+
CLISpecRegistry._store["fake-provider"] = fake_spec # type: ignore[assignment]
117117

118118
parser = _fresh_parser()
119119
add_provider_type_arg(parser)
@@ -124,15 +124,15 @@ def test_new_provider_reflected_when_registry_is_expanded(self):
124124
assert action.choices is not None
125125
assert "fake-provider" in action.choices
126126
finally:
127-
CLISpecRegistry._specs = original_specs
127+
CLISpecRegistry._store = original_specs
128128

129129
def test_no_choices_without_registry_entries(self):
130130
"""When the registry is empty, choices is None (open-ended)."""
131131
from orb.infrastructure.registry.cli_spec_registry import CLISpecRegistry
132132

133-
original_specs = dict(CLISpecRegistry._specs)
133+
original_specs = dict(CLISpecRegistry._store)
134134
try:
135-
CLISpecRegistry._specs = {}
135+
CLISpecRegistry._store = {}
136136

137137
parser = _fresh_parser()
138138
add_provider_type_arg(parser)
@@ -142,7 +142,7 @@ def test_no_choices_without_registry_entries(self):
142142
)
143143
assert action.choices is None
144144
finally:
145-
CLISpecRegistry._specs = original_specs
145+
CLISpecRegistry._store = original_specs
146146

147147
def test_extra_help_is_appended(self):
148148
parser = _fresh_parser()
@@ -265,10 +265,10 @@ def test_is_sorted(self):
265265
def test_tolerates_empty_registry(self):
266266
from orb.infrastructure.registry.cli_spec_registry import CLISpecRegistry
267267

268-
original = dict(CLISpecRegistry._specs)
268+
original = dict(CLISpecRegistry._store)
269269
try:
270-
CLISpecRegistry._specs = {}
270+
CLISpecRegistry._store = {}
271271
result = _registered_provider_types()
272272
assert result == []
273273
finally:
274-
CLISpecRegistry._specs = original
274+
CLISpecRegistry._store = original

0 commit comments

Comments
 (0)