Skip to content

Commit df0f3db

Browse files
committed
Rename test_invalid_object_expansion_strategy to test_invalid_object_expansion_processor and add additional test for invalid strategy handling
1 parent a03008a commit df0f3db

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tests/unit/sdk/spec/test_object.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ async def test_get_relationship_info_tags(
230230
assert rel_info.format == format
231231

232232

233-
async def test_invalid_object_expansion_strategy(
233+
async def test_invalid_object_expansion_processor(
234234
client: InfrahubClient, mock_schema_query_01: HTTPXMock, location_expansion
235235
) -> None:
236236
obj = ObjectFile(location="some/path", content=location_expansion)
@@ -246,3 +246,12 @@ async def test_invalid_object_expansion_strategy(
246246
assert "Unknown strategy" in str(exc.value)
247247
finally:
248248
DataProcessorFactory._processors = original_processors
249+
250+
251+
async def test_invalid_object_expansion_strategy(client: InfrahubClient, location_expansion) -> None:
252+
location_expansion["spec"]["strategy"] = "InvalidStrategy"
253+
obj = ObjectFile(location="some/path", content=location_expansion)
254+
255+
with pytest.raises(ValidationError) as exc:
256+
await obj.validate_format(client=client)
257+
assert "Input should be" in str(exc.value)

0 commit comments

Comments
 (0)