MCPcopy Create free account
hub / github.com/dagger/dagger / test_func_doc_deprecated_args

Function test_func_doc_deprecated_args

sdk/python/tests/codegen/test_generator.py:348–374  ·  view source on GitHub ↗
(ctx: Context)

Source from the content-addressed store, hash-verified

346
347
348def test_func_doc_deprecated_args(ctx: Context):
349 field = Field(
350 String,
351 {
352 "path": Argument(NonNull(String)),
353 "configDir": Argument(
354 String,
355 deprecation_reason="Use `configPath` instead.",
356 ),
357 },
358 deprecation_reason="Use apply_config instead.",
359 )
360
361 parent = Object("Container", lambda: {"apply": field})
362 handler = _ObjectField(ctx, "apply", field, parent)
363
364 docstring = handler.func_doc()
365
366 assert "Parameters" in docstring
367 assert ".. deprecated::\n Use apply_config instead." in docstring
368 doc_lines = {line.strip() for line in docstring.splitlines()}
369 assert "config_dir:" in doc_lines
370 assert ".. deprecated:: Use config_path instead." in doc_lines
371
372 body = handler.func_body()
373 normalized = body.replace('\\"', '"')
374 assert 'Method "apply" is deprecated: Use apply_config instead.' in normalized
375
376
377def test_interface_methods_deprecated(ctx: Context):

Callers

nothing calls this directly

Calls 8

_ObjectFieldClass · 0.90
NonNullFunction · 0.85
func_docMethod · 0.80
func_bodyMethod · 0.80
replaceMethod · 0.80
FieldClass · 0.50
ArgumentStruct · 0.50
ObjectClass · 0.50

Tested by

no test coverage detected