()
| 266 | |
| 267 | |
| 268 | async 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 | |
| 283 | class TestFunctionFromExternalConstructor: |
nothing calls this directly
no test coverage detected