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

Function test_non_constructor_create_function

sdk/python/tests/mod/test_results.py:268–280  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

266
267
268async def test_non_constructor_create_function():
269 mod = Module()
270
271 @mod.object_type
272 class Foo:
273 foo: str = mod.field(default="foo")
274
275 # Non classmethod can use the name `create`.
276 @mod.function
277 def create(self) -> str:
278 return f"{self.foo}bar"
279
280 assert await mod.get_result("Foo", {}, "create", {}) == "foobar"
281
282
283class TestFunctionFromExternalConstructor:

Callers

nothing calls this directly

Calls 2

get_resultMethod · 0.95
ModuleClass · 0.90

Tested by

no test coverage detected