@typespec/emitter-framework 0.15.0-dev.2 → 0.15.0-dev.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -16
- package/dist/src/core/components/overrides/component-overrides.d.ts.map +1 -1
- package/dist/src/core/components/overrides/component-overrides.js.map +1 -1
- package/dist/src/python/builtins.d.ts +14 -0
- package/dist/src/python/builtins.d.ts.map +1 -0
- package/dist/src/python/builtins.js +29 -0
- package/dist/src/python/builtins.js.map +1 -0
- package/dist/src/python/components/array-expression/array-expression.d.ts +6 -0
- package/dist/src/python/components/array-expression/array-expression.d.ts.map +1 -0
- package/dist/src/python/components/array-expression/array-expression.js +11 -0
- package/dist/src/python/components/array-expression/array-expression.js.map +1 -0
- package/dist/src/python/components/array-expression/array-expression.test.d.ts +2 -0
- package/dist/src/python/components/array-expression/array-expression.test.d.ts.map +1 -0
- package/dist/src/python/components/array-expression/array-expression.test.js +19 -0
- package/dist/src/python/components/array-expression/array-expression.test.js.map +1 -0
- package/dist/src/python/components/array-expression/index.d.ts +2 -0
- package/dist/src/python/components/array-expression/index.d.ts.map +1 -0
- package/dist/src/python/components/array-expression/index.js +2 -0
- package/dist/src/python/components/array-expression/index.js.map +1 -0
- package/dist/src/python/components/atom/atom.d.ts +33 -0
- package/dist/src/python/components/atom/atom.d.ts.map +1 -0
- package/dist/src/python/components/atom/atom.js +88 -0
- package/dist/src/python/components/atom/atom.js.map +1 -0
- package/dist/src/python/components/atom/atom.test.d.ts +2 -0
- package/dist/src/python/components/atom/atom.test.d.ts.map +1 -0
- package/dist/src/python/components/atom/atom.test.js +224 -0
- package/dist/src/python/components/atom/atom.test.js.map +1 -0
- package/dist/src/python/components/atom/index.d.ts +2 -0
- package/dist/src/python/components/atom/index.d.ts.map +1 -0
- package/dist/src/python/components/atom/index.js +2 -0
- package/dist/src/python/components/atom/index.js.map +1 -0
- package/dist/src/python/components/class-declaration/class-bases.d.ts +45 -0
- package/dist/src/python/components/class-declaration/class-bases.d.ts.map +1 -0
- package/dist/src/python/components/class-declaration/class-bases.js +84 -0
- package/dist/src/python/components/class-declaration/class-bases.js.map +1 -0
- package/dist/src/python/components/class-declaration/class-body.d.ts +16 -0
- package/dist/src/python/components/class-declaration/class-body.d.ts.map +1 -0
- package/dist/src/python/components/class-declaration/class-body.js +52 -0
- package/dist/src/python/components/class-declaration/class-body.js.map +1 -0
- package/dist/src/python/components/class-declaration/class-declaration.d.ts +23 -0
- package/dist/src/python/components/class-declaration/class-declaration.d.ts.map +1 -0
- package/dist/src/python/components/class-declaration/class-declaration.js +118 -0
- package/dist/src/python/components/class-declaration/class-declaration.js.map +1 -0
- package/dist/src/python/components/class-declaration/class-declaration.test.d.ts +2 -0
- package/dist/src/python/components/class-declaration/class-declaration.test.d.ts.map +1 -0
- package/dist/src/python/components/class-declaration/class-declaration.test.js +1527 -0
- package/dist/src/python/components/class-declaration/class-declaration.test.js.map +1 -0
- package/dist/src/python/components/class-declaration/class-member.d.ts +16 -0
- package/dist/src/python/components/class-declaration/class-member.d.ts.map +1 -0
- package/dist/src/python/components/class-declaration/class-member.js +71 -0
- package/dist/src/python/components/class-declaration/class-member.js.map +1 -0
- package/dist/src/python/components/class-declaration/class-member.test.d.ts +2 -0
- package/dist/src/python/components/class-declaration/class-member.test.d.ts.map +1 -0
- package/dist/src/python/components/class-declaration/class-member.test.js +202 -0
- package/dist/src/python/components/class-declaration/class-member.test.js.map +1 -0
- package/dist/src/python/components/class-declaration/class-method.d.ts +22 -0
- package/dist/src/python/components/class-declaration/class-method.d.ts.map +1 -0
- package/dist/src/python/components/class-declaration/class-method.js +76 -0
- package/dist/src/python/components/class-declaration/class-method.js.map +1 -0
- package/dist/src/python/components/class-declaration/class-method.test.d.ts +2 -0
- package/dist/src/python/components/class-declaration/class-method.test.d.ts.map +1 -0
- package/dist/src/python/components/class-declaration/class-method.test.js +298 -0
- package/dist/src/python/components/class-declaration/class-method.test.js.map +1 -0
- package/dist/src/python/components/class-declaration/index.d.ts +7 -0
- package/dist/src/python/components/class-declaration/index.d.ts.map +1 -0
- package/dist/src/python/components/class-declaration/index.js +7 -0
- package/dist/src/python/components/class-declaration/index.js.map +1 -0
- package/dist/src/python/components/class-declaration/primitive-initializer.d.ts +22 -0
- package/dist/src/python/components/class-declaration/primitive-initializer.d.ts.map +1 -0
- package/dist/src/python/components/class-declaration/primitive-initializer.js +67 -0
- package/dist/src/python/components/class-declaration/primitive-initializer.js.map +1 -0
- package/dist/src/python/components/doc-element/doc-element.d.ts +46 -0
- package/dist/src/python/components/doc-element/doc-element.d.ts.map +1 -0
- package/dist/src/python/components/doc-element/doc-element.js +59 -0
- package/dist/src/python/components/doc-element/doc-element.js.map +1 -0
- package/dist/src/python/components/doc-element/index.d.ts +2 -0
- package/dist/src/python/components/doc-element/index.d.ts.map +1 -0
- package/dist/src/python/components/doc-element/index.js +2 -0
- package/dist/src/python/components/doc-element/index.js.map +1 -0
- package/dist/src/python/components/enum-declaration/enum-declaration.d.ts +8 -0
- package/dist/src/python/components/enum-declaration/enum-declaration.d.ts.map +1 -0
- package/dist/src/python/components/enum-declaration/enum-declaration.js +80 -0
- package/dist/src/python/components/enum-declaration/enum-declaration.js.map +1 -0
- package/dist/src/python/components/enum-declaration/enum-declaration.test.d.ts +2 -0
- package/dist/src/python/components/enum-declaration/enum-declaration.test.d.ts.map +1 -0
- package/dist/src/python/components/enum-declaration/enum-declaration.test.js +344 -0
- package/dist/src/python/components/enum-declaration/enum-declaration.test.js.map +1 -0
- package/dist/src/python/components/enum-declaration/enum-member.d.ts +9 -0
- package/dist/src/python/components/enum-declaration/enum-member.d.ts.map +1 -0
- package/dist/src/python/components/enum-declaration/enum-member.js +22 -0
- package/dist/src/python/components/enum-declaration/enum-member.js.map +1 -0
- package/dist/src/python/components/enum-declaration/index.d.ts +3 -0
- package/dist/src/python/components/enum-declaration/index.d.ts.map +1 -0
- package/dist/src/python/components/enum-declaration/index.js +3 -0
- package/dist/src/python/components/enum-declaration/index.js.map +1 -0
- package/dist/src/python/components/function-declaration/function-declaration.d.ts +24 -0
- package/dist/src/python/components/function-declaration/function-declaration.d.ts.map +1 -0
- package/dist/src/python/components/function-declaration/function-declaration.js +68 -0
- package/dist/src/python/components/function-declaration/function-declaration.js.map +1 -0
- package/dist/src/python/components/function-declaration/function-declaration.test.d.ts +2 -0
- package/dist/src/python/components/function-declaration/function-declaration.test.d.ts.map +1 -0
- package/dist/src/python/components/function-declaration/function-declaration.test.js +682 -0
- package/dist/src/python/components/function-declaration/function-declaration.test.js.map +1 -0
- package/dist/src/python/components/function-declaration/index.d.ts +2 -0
- package/dist/src/python/components/function-declaration/index.d.ts.map +1 -0
- package/dist/src/python/components/function-declaration/index.js +2 -0
- package/dist/src/python/components/function-declaration/index.js.map +1 -0
- package/dist/src/python/components/index.d.ts +12 -0
- package/dist/src/python/components/index.d.ts.map +1 -0
- package/dist/src/python/components/index.js +12 -0
- package/dist/src/python/components/index.js.map +1 -0
- package/dist/src/python/components/protocol-declaration/callable-parameters.d.ts +25 -0
- package/dist/src/python/components/protocol-declaration/callable-parameters.d.ts.map +1 -0
- package/dist/src/python/components/protocol-declaration/callable-parameters.js +33 -0
- package/dist/src/python/components/protocol-declaration/callable-parameters.js.map +1 -0
- package/dist/src/python/components/protocol-declaration/index.d.ts +3 -0
- package/dist/src/python/components/protocol-declaration/index.d.ts.map +1 -0
- package/dist/src/python/components/protocol-declaration/index.js +3 -0
- package/dist/src/python/components/protocol-declaration/index.js.map +1 -0
- package/dist/src/python/components/protocol-declaration/protocol-declaration.d.ts +8 -0
- package/dist/src/python/components/protocol-declaration/protocol-declaration.d.ts.map +1 -0
- package/dist/src/python/components/protocol-declaration/protocol-declaration.js +86 -0
- package/dist/src/python/components/protocol-declaration/protocol-declaration.js.map +1 -0
- package/dist/src/python/components/protocol-declaration/protocol-declaration.test.d.ts +2 -0
- package/dist/src/python/components/protocol-declaration/protocol-declaration.test.d.ts.map +1 -0
- package/dist/src/python/components/protocol-declaration/protocol-declaration.test.js +117 -0
- package/dist/src/python/components/protocol-declaration/protocol-declaration.test.js.map +1 -0
- package/dist/src/python/components/record-expression/index.d.ts +2 -0
- package/dist/src/python/components/record-expression/index.d.ts.map +1 -0
- package/dist/src/python/components/record-expression/index.js +2 -0
- package/dist/src/python/components/record-expression/index.js.map +1 -0
- package/dist/src/python/components/record-expression/record-expression.d.ts +6 -0
- package/dist/src/python/components/record-expression/record-expression.d.ts.map +1 -0
- package/dist/src/python/components/record-expression/record-expression.js +13 -0
- package/dist/src/python/components/record-expression/record-expression.js.map +1 -0
- package/dist/src/python/components/record-expression/record-expression.test.d.ts +2 -0
- package/dist/src/python/components/record-expression/record-expression.test.d.ts.map +1 -0
- package/dist/src/python/components/record-expression/record-expression.test.js +19 -0
- package/dist/src/python/components/record-expression/record-expression.test.js.map +1 -0
- package/dist/src/python/components/type-alias-declaration/index.d.ts +2 -0
- package/dist/src/python/components/type-alias-declaration/index.d.ts.map +1 -0
- package/dist/src/python/components/type-alias-declaration/index.js +2 -0
- package/dist/src/python/components/type-alias-declaration/index.js.map +1 -0
- package/dist/src/python/components/type-alias-declaration/type-alias-declaration.d.ts +16 -0
- package/dist/src/python/components/type-alias-declaration/type-alias-declaration.d.ts.map +1 -0
- package/dist/src/python/components/type-alias-declaration/type-alias-declaration.js +75 -0
- package/dist/src/python/components/type-alias-declaration/type-alias-declaration.js.map +1 -0
- package/dist/src/python/components/type-alias-declaration/type-alias-declaration.test.d.ts +2 -0
- package/dist/src/python/components/type-alias-declaration/type-alias-declaration.test.d.ts.map +1 -0
- package/dist/src/python/components/type-alias-declaration/type-alias-declaration.test.js +140 -0
- package/dist/src/python/components/type-alias-declaration/type-alias-declaration.test.js.map +1 -0
- package/dist/src/python/components/type-declaration/index.d.ts +2 -0
- package/dist/src/python/components/type-declaration/index.d.ts.map +1 -0
- package/dist/src/python/components/type-declaration/index.js +2 -0
- package/dist/src/python/components/type-declaration/index.js.map +1 -0
- package/dist/src/python/components/type-declaration/type-declaration.d.ts +11 -0
- package/dist/src/python/components/type-declaration/type-declaration.d.ts.map +1 -0
- package/dist/src/python/components/type-declaration/type-declaration.js +31 -0
- package/dist/src/python/components/type-declaration/type-declaration.js.map +1 -0
- package/dist/src/python/components/type-declaration/type-declaration.test.d.ts +2 -0
- package/dist/src/python/components/type-declaration/type-declaration.test.d.ts.map +1 -0
- package/dist/src/python/components/type-declaration/type-declaration.test.js +69 -0
- package/dist/src/python/components/type-declaration/type-declaration.test.js.map +1 -0
- package/dist/src/python/components/type-expression/index.d.ts +2 -0
- package/dist/src/python/components/type-expression/index.d.ts.map +1 -0
- package/dist/src/python/components/type-expression/index.js +2 -0
- package/dist/src/python/components/type-expression/index.js.map +1 -0
- package/dist/src/python/components/type-expression/type-expression.d.ts +12 -0
- package/dist/src/python/components/type-expression/type-expression.d.ts.map +1 -0
- package/dist/src/python/components/type-expression/type-expression.js +348 -0
- package/dist/src/python/components/type-expression/type-expression.js.map +1 -0
- package/dist/src/python/components/type-expression/type-expression.test.d.ts +2 -0
- package/dist/src/python/components/type-expression/type-expression.test.d.ts.map +1 -0
- package/dist/src/python/components/type-expression/type-expression.test.js +503 -0
- package/dist/src/python/components/type-expression/type-expression.test.js.map +1 -0
- package/dist/src/python/index.d.ts +4 -0
- package/dist/src/python/index.d.ts.map +1 -0
- package/dist/src/python/index.js +4 -0
- package/dist/src/python/index.js.map +1 -0
- package/dist/src/python/lib.d.ts +68 -0
- package/dist/src/python/lib.d.ts.map +1 -0
- package/dist/src/python/lib.js +38 -0
- package/dist/src/python/lib.js.map +1 -0
- package/dist/src/python/test-utils.d.ts +8 -0
- package/dist/src/python/test-utils.d.ts.map +1 -0
- package/dist/src/python/test-utils.js +25 -0
- package/dist/src/python/test-utils.js.map +1 -0
- package/dist/src/python/utils/index.d.ts +4 -0
- package/dist/src/python/utils/index.d.ts.map +1 -0
- package/dist/src/python/utils/index.js +4 -0
- package/dist/src/python/utils/index.js.map +1 -0
- package/dist/src/python/utils/operation.d.ts +27 -0
- package/dist/src/python/utils/operation.d.ts.map +1 -0
- package/dist/src/python/utils/operation.js +139 -0
- package/dist/src/python/utils/operation.js.map +1 -0
- package/dist/src/python/utils/refkey.d.ts +23 -0
- package/dist/src/python/utils/refkey.d.ts.map +1 -0
- package/dist/src/python/utils/refkey.js +36 -0
- package/dist/src/python/utils/refkey.js.map +1 -0
- package/dist/src/python/utils/type.d.ts +19 -0
- package/dist/src/python/utils/type.d.ts.map +1 -0
- package/dist/src/python/utils/type.js +24 -0
- package/dist/src/python/utils/type.js.map +1 -0
- package/dist/src/typescript/components/function-declaration.d.ts.map +1 -1
- package/dist/src/typescript/components/function-declaration.js.map +1 -1
- package/package.json +12 -4
- package/package.json.bak +13 -4
- package/src/core/components/overrides/component-overrides.tsx +9 -6
- package/src/python/builtins.ts +43 -0
- package/src/python/components/array-expression/array-expression.test.tsx +14 -0
- package/src/python/components/array-expression/array-expression.tsx +11 -0
- package/src/python/components/array-expression/index.ts +1 -0
- package/src/python/components/atom/atom.test.tsx +244 -0
- package/src/python/components/atom/atom.tsx +95 -0
- package/src/python/components/atom/index.ts +1 -0
- package/src/python/components/class-declaration/class-bases.tsx +92 -0
- package/src/python/components/class-declaration/class-body.tsx +56 -0
- package/src/python/components/class-declaration/class-declaration.test.tsx +1414 -0
- package/src/python/components/class-declaration/class-declaration.tsx +116 -0
- package/src/python/components/class-declaration/class-member.test.tsx +194 -0
- package/src/python/components/class-declaration/class-member.tsx +67 -0
- package/src/python/components/class-declaration/class-method.test.tsx +250 -0
- package/src/python/components/class-declaration/class-method.tsx +97 -0
- package/src/python/components/class-declaration/index.ts +6 -0
- package/src/python/components/class-declaration/primitive-initializer.tsx +62 -0
- package/src/python/components/doc-element/doc-element.tsx +83 -0
- package/src/python/components/doc-element/index.ts +1 -0
- package/src/python/components/enum-declaration/enum-declaration.test.tsx +319 -0
- package/src/python/components/enum-declaration/enum-declaration.tsx +77 -0
- package/src/python/components/enum-declaration/enum-member.tsx +21 -0
- package/src/python/components/enum-declaration/index.ts +2 -0
- package/src/python/components/function-declaration/function-declaration.test.tsx +582 -0
- package/src/python/components/function-declaration/function-declaration.tsx +90 -0
- package/src/python/components/function-declaration/index.ts +1 -0
- package/src/python/components/index.ts +11 -0
- package/src/python/components/protocol-declaration/callable-parameters.tsx +44 -0
- package/src/python/components/protocol-declaration/index.ts +2 -0
- package/src/python/components/protocol-declaration/protocol-declaration.test.tsx +106 -0
- package/src/python/components/protocol-declaration/protocol-declaration.tsx +73 -0
- package/src/python/components/record-expression/index.ts +1 -0
- package/src/python/components/record-expression/record-expression.test.tsx +14 -0
- package/src/python/components/record-expression/record-expression.tsx +13 -0
- package/src/python/components/type-alias-declaration/index.ts +1 -0
- package/src/python/components/type-alias-declaration/type-alias-declaration.test.tsx +117 -0
- package/src/python/components/type-alias-declaration/type-alias-declaration.tsx +67 -0
- package/src/python/components/type-declaration/index.ts +1 -0
- package/src/python/components/type-declaration/type-declaration.test.tsx +58 -0
- package/src/python/components/type-declaration/type-declaration.tsx +26 -0
- package/src/python/components/type-expression/index.ts +1 -0
- package/src/python/components/type-expression/type-expression.test.tsx +463 -0
- package/src/python/components/type-expression/type-expression.tsx +333 -0
- package/src/python/index.ts +3 -0
- package/src/python/lib.ts +40 -0
- package/src/python/test-utils.tsx +31 -0
- package/src/python/utils/index.ts +3 -0
- package/src/python/utils/operation.ts +161 -0
- package/src/python/utils/refkey.ts +36 -0
- package/src/python/utils/type.ts +31 -0
- package/src/typescript/components/function-declaration.tsx +4 -2
|
@@ -0,0 +1,682 @@
|
|
|
1
|
+
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import { getOutput } from "#python/test-utils.js";
|
|
3
|
+
import { Tester } from "#test/test-host.js";
|
|
4
|
+
import * as py from "@alloy-js/python";
|
|
5
|
+
import { t } from "@typespec/compiler/testing";
|
|
6
|
+
import { describe, expect, it } from "vitest";
|
|
7
|
+
import { FunctionDeclaration } from "./function-declaration.js";
|
|
8
|
+
describe("Python Function Declaration", () => {
|
|
9
|
+
it("creates a function with single positional param", async () => {
|
|
10
|
+
const {
|
|
11
|
+
program,
|
|
12
|
+
getName
|
|
13
|
+
} = await Tester.compile(t.code`
|
|
14
|
+
op ${t.op("getName")}(id: string): string;
|
|
15
|
+
`);
|
|
16
|
+
expect(getOutput(program, [_$createComponent(FunctionDeclaration, {
|
|
17
|
+
type: getName
|
|
18
|
+
})])).toRenderTo(`
|
|
19
|
+
def get_name(id: str) -> str:
|
|
20
|
+
pass
|
|
21
|
+
|
|
22
|
+
`);
|
|
23
|
+
});
|
|
24
|
+
it("creates an async function", async () => {
|
|
25
|
+
const {
|
|
26
|
+
program,
|
|
27
|
+
getName
|
|
28
|
+
} = await Tester.compile(t.code`
|
|
29
|
+
op ${t.op("getName")}(id: string): string;
|
|
30
|
+
`);
|
|
31
|
+
expect(getOutput(program, [_$createComponent(FunctionDeclaration, {
|
|
32
|
+
async: true,
|
|
33
|
+
type: getName
|
|
34
|
+
})])).toRenderTo(`
|
|
35
|
+
async def get_name(id: str) -> str:
|
|
36
|
+
pass
|
|
37
|
+
|
|
38
|
+
`);
|
|
39
|
+
});
|
|
40
|
+
it("creates a function with a custom name", async () => {
|
|
41
|
+
const {
|
|
42
|
+
program,
|
|
43
|
+
getName
|
|
44
|
+
} = await Tester.compile(t.code`
|
|
45
|
+
op ${t.op("getName")}(id: string): string;
|
|
46
|
+
`);
|
|
47
|
+
expect(getOutput(program, [_$createComponent(FunctionDeclaration, {
|
|
48
|
+
name: "new_name",
|
|
49
|
+
type: getName
|
|
50
|
+
})])).toRenderTo(`
|
|
51
|
+
def new_name(id: str) -> str:
|
|
52
|
+
pass
|
|
53
|
+
|
|
54
|
+
`);
|
|
55
|
+
});
|
|
56
|
+
it("creates a function with additional keyword-only parameters", async () => {
|
|
57
|
+
const {
|
|
58
|
+
program,
|
|
59
|
+
createPerson
|
|
60
|
+
} = await Tester.compile(t.code`
|
|
61
|
+
op ${t.op("createPerson")}(id: string): string;
|
|
62
|
+
`);
|
|
63
|
+
expect(getOutput(program, [_$createComponent(FunctionDeclaration, {
|
|
64
|
+
type: createPerson,
|
|
65
|
+
parameters: [{
|
|
66
|
+
name: "name",
|
|
67
|
+
type: "str"
|
|
68
|
+
}, {
|
|
69
|
+
name: "age",
|
|
70
|
+
type: "float"
|
|
71
|
+
}]
|
|
72
|
+
})])).toRenderTo(`
|
|
73
|
+
def create_person(id: str, *, name: str, age: float) -> str:
|
|
74
|
+
pass
|
|
75
|
+
|
|
76
|
+
`);
|
|
77
|
+
});
|
|
78
|
+
it("creates a function with additional keyword-only parameters (string shorthand)", async () => {
|
|
79
|
+
const {
|
|
80
|
+
program,
|
|
81
|
+
createPerson
|
|
82
|
+
} = await Tester.compile(t.code`
|
|
83
|
+
op ${t.op("createPerson")}(id: string): string;
|
|
84
|
+
`);
|
|
85
|
+
expect(getOutput(program, [_$createComponent(FunctionDeclaration, {
|
|
86
|
+
type: createPerson,
|
|
87
|
+
parameters: ["name", "age"]
|
|
88
|
+
})])).toRenderTo(`
|
|
89
|
+
def create_person(id: str, *, name, age) -> str:
|
|
90
|
+
pass
|
|
91
|
+
|
|
92
|
+
`);
|
|
93
|
+
});
|
|
94
|
+
it("creates a function replacing parameters with raw params provided", async () => {
|
|
95
|
+
const {
|
|
96
|
+
program,
|
|
97
|
+
createPerson
|
|
98
|
+
} = await Tester.compile(t.code`
|
|
99
|
+
op ${t.op("createPerson")}(id: string): string;
|
|
100
|
+
`);
|
|
101
|
+
expect(getOutput(program, [_$createComponent(FunctionDeclaration, {
|
|
102
|
+
type: createPerson,
|
|
103
|
+
parameters: ["name", "age"],
|
|
104
|
+
replaceParameters: true
|
|
105
|
+
})])).toRenderTo(`
|
|
106
|
+
def create_person(*, name, age) -> str:
|
|
107
|
+
pass
|
|
108
|
+
|
|
109
|
+
`);
|
|
110
|
+
});
|
|
111
|
+
it("creates a function replacing parameters with params having defaults (requires * marker)", async () => {
|
|
112
|
+
const {
|
|
113
|
+
program,
|
|
114
|
+
createPerson
|
|
115
|
+
} = await Tester.compile(t.code`
|
|
116
|
+
op ${t.op("createPerson")}(id: string): string;
|
|
117
|
+
`);
|
|
118
|
+
expect(getOutput(program, [_$createComponent(FunctionDeclaration, {
|
|
119
|
+
type: createPerson,
|
|
120
|
+
get parameters() {
|
|
121
|
+
return [{
|
|
122
|
+
name: "name",
|
|
123
|
+
type: "str",
|
|
124
|
+
default: _$createComponent(py.Atom, {
|
|
125
|
+
jsValue: "alice"
|
|
126
|
+
})
|
|
127
|
+
}, {
|
|
128
|
+
name: "age",
|
|
129
|
+
type: "int",
|
|
130
|
+
default: _$createComponent(py.Atom, {
|
|
131
|
+
jsValue: 30
|
|
132
|
+
})
|
|
133
|
+
}];
|
|
134
|
+
},
|
|
135
|
+
replaceParameters: true
|
|
136
|
+
})])).toRenderTo(`
|
|
137
|
+
def create_person(*, name: str = "alice", age: int = 30) -> str:
|
|
138
|
+
pass
|
|
139
|
+
|
|
140
|
+
`);
|
|
141
|
+
});
|
|
142
|
+
it("creates a function with defaults in raw parameter descriptors", async () => {
|
|
143
|
+
const {
|
|
144
|
+
program,
|
|
145
|
+
createPerson
|
|
146
|
+
} = await Tester.compile(t.code`
|
|
147
|
+
op ${t.op("createPerson")}(id: string, locale: string = "en-US"): string;
|
|
148
|
+
`);
|
|
149
|
+
expect(getOutput(program, [_$createComponent(FunctionDeclaration, {
|
|
150
|
+
type: createPerson,
|
|
151
|
+
get parameters() {
|
|
152
|
+
return [{
|
|
153
|
+
name: "limit",
|
|
154
|
+
type: "int",
|
|
155
|
+
default: _$createComponent(py.Atom, {
|
|
156
|
+
jsValue: 10
|
|
157
|
+
})
|
|
158
|
+
}, {
|
|
159
|
+
name: "verbose",
|
|
160
|
+
type: "bool",
|
|
161
|
+
default: _$createComponent(py.Atom, {
|
|
162
|
+
jsValue: true
|
|
163
|
+
})
|
|
164
|
+
}];
|
|
165
|
+
}
|
|
166
|
+
})])).toRenderTo(`
|
|
167
|
+
def create_person(id: str, *, locale: str = "en-US", limit: int = 10, verbose: bool = True) -> str:
|
|
168
|
+
pass
|
|
169
|
+
|
|
170
|
+
`);
|
|
171
|
+
});
|
|
172
|
+
it("creates a function building parameters from a model via parametersModel (will replace parameters)", async () => {
|
|
173
|
+
const {
|
|
174
|
+
program,
|
|
175
|
+
createPerson,
|
|
176
|
+
Foo
|
|
177
|
+
} = await Tester.compile(t.code`
|
|
178
|
+
op ${t.op("createPerson")}(id: string): string;
|
|
179
|
+
|
|
180
|
+
model ${t.model("Foo")} {
|
|
181
|
+
name: string;
|
|
182
|
+
age: int32;
|
|
183
|
+
}
|
|
184
|
+
`);
|
|
185
|
+
expect(getOutput(program, [_$createComponent(FunctionDeclaration, {
|
|
186
|
+
type: createPerson,
|
|
187
|
+
parametersModel: Foo
|
|
188
|
+
})])).toRenderTo(`
|
|
189
|
+
def create_person(name: str, age: int) -> str:
|
|
190
|
+
pass
|
|
191
|
+
|
|
192
|
+
`);
|
|
193
|
+
});
|
|
194
|
+
it("creates a function with parametersModel applying defaults and optionals", async () => {
|
|
195
|
+
const {
|
|
196
|
+
program,
|
|
197
|
+
createPerson,
|
|
198
|
+
Foo
|
|
199
|
+
} = await Tester.compile(t.code`
|
|
200
|
+
op ${t.op("createPerson")}(id: string): string;
|
|
201
|
+
|
|
202
|
+
model ${t.model("Foo")} {
|
|
203
|
+
requiredName?: string = "alice";
|
|
204
|
+
optionalAge?: int32;
|
|
205
|
+
}
|
|
206
|
+
`);
|
|
207
|
+
expect(getOutput(program, [_$createComponent(FunctionDeclaration, {
|
|
208
|
+
type: createPerson,
|
|
209
|
+
parametersModel: Foo
|
|
210
|
+
})])).toRenderTo(`
|
|
211
|
+
def create_person(*, required_name: str = "alice", optional_age: int = None) -> str:
|
|
212
|
+
pass
|
|
213
|
+
|
|
214
|
+
`);
|
|
215
|
+
});
|
|
216
|
+
it("creates a function that replaces parameters with parametersModel even when extras are provided", async () => {
|
|
217
|
+
const {
|
|
218
|
+
program,
|
|
219
|
+
createPerson,
|
|
220
|
+
Foo
|
|
221
|
+
} = await Tester.compile(t.code`
|
|
222
|
+
op ${t.op("createPerson")}(id: string): string;
|
|
223
|
+
|
|
224
|
+
model ${t.model("Foo")} {
|
|
225
|
+
name: string;
|
|
226
|
+
age: int32;
|
|
227
|
+
}
|
|
228
|
+
`);
|
|
229
|
+
expect(getOutput(program, [_$createComponent(FunctionDeclaration, {
|
|
230
|
+
type: createPerson,
|
|
231
|
+
parametersModel: Foo,
|
|
232
|
+
parameters: ["extra"]
|
|
233
|
+
})])).toRenderTo(`
|
|
234
|
+
def create_person(name: str, age: int) -> str:
|
|
235
|
+
pass
|
|
236
|
+
|
|
237
|
+
`);
|
|
238
|
+
});
|
|
239
|
+
it("creates a function overriding the return type", async () => {
|
|
240
|
+
const {
|
|
241
|
+
program,
|
|
242
|
+
getName
|
|
243
|
+
} = await Tester.compile(t.code`
|
|
244
|
+
op ${t.op("getName")}(id: string): string;
|
|
245
|
+
`);
|
|
246
|
+
expect(getOutput(program, [_$createComponent(FunctionDeclaration, {
|
|
247
|
+
type: getName,
|
|
248
|
+
returnType: "ASpecialString"
|
|
249
|
+
})])).toRenderTo(`
|
|
250
|
+
def get_name(id: str) -> ASpecialString:
|
|
251
|
+
pass
|
|
252
|
+
|
|
253
|
+
`);
|
|
254
|
+
});
|
|
255
|
+
it("creates a function with body", async () => {
|
|
256
|
+
const {
|
|
257
|
+
program,
|
|
258
|
+
createPerson
|
|
259
|
+
} = await Tester.compile(t.code`
|
|
260
|
+
op ${t.op("createPerson")}(id: string): string;
|
|
261
|
+
`);
|
|
262
|
+
expect(getOutput(program, [_$createComponent(FunctionDeclaration, {
|
|
263
|
+
type: createPerson,
|
|
264
|
+
get children() {
|
|
265
|
+
return ["print(\"Hello World!\")"];
|
|
266
|
+
}
|
|
267
|
+
})])).toRenderTo(`
|
|
268
|
+
def create_person(id: str) -> str:
|
|
269
|
+
print("Hello World!")
|
|
270
|
+
|
|
271
|
+
`);
|
|
272
|
+
});
|
|
273
|
+
it("creates a function with a doc", async () => {
|
|
274
|
+
const {
|
|
275
|
+
program,
|
|
276
|
+
getName
|
|
277
|
+
} = await Tester.compile(t.code`
|
|
278
|
+
op ${t.op("getName")}(id: string): string;
|
|
279
|
+
`);
|
|
280
|
+
expect(getOutput(program, [_$createComponent(FunctionDeclaration, {
|
|
281
|
+
type: getName,
|
|
282
|
+
doc: "This is a test doc"
|
|
283
|
+
})])).toRenderTo(`
|
|
284
|
+
def get_name(id: str) -> str:
|
|
285
|
+
"""
|
|
286
|
+
This is a test doc
|
|
287
|
+
"""
|
|
288
|
+
|
|
289
|
+
pass
|
|
290
|
+
|
|
291
|
+
`);
|
|
292
|
+
});
|
|
293
|
+
it("creates a function with a multi-paragraph FunctionDoc", async () => {
|
|
294
|
+
const {
|
|
295
|
+
program,
|
|
296
|
+
getName
|
|
297
|
+
} = await Tester.compile(t.code`
|
|
298
|
+
op ${t.op("getName")}(id: string): string;
|
|
299
|
+
`);
|
|
300
|
+
expect(getOutput(program, [_$createComponent(FunctionDeclaration, {
|
|
301
|
+
type: getName,
|
|
302
|
+
get doc() {
|
|
303
|
+
return _$createComponent(py.FunctionDoc, {
|
|
304
|
+
get description() {
|
|
305
|
+
return [["First paragraph"], ["Second paragraph"]];
|
|
306
|
+
}
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
})])).toRenderTo(`
|
|
310
|
+
def get_name(id: str) -> str:
|
|
311
|
+
"""
|
|
312
|
+
First paragraph
|
|
313
|
+
|
|
314
|
+
Second paragraph
|
|
315
|
+
"""
|
|
316
|
+
|
|
317
|
+
pass
|
|
318
|
+
|
|
319
|
+
`);
|
|
320
|
+
});
|
|
321
|
+
it("creates a function with doc as string[]", async () => {
|
|
322
|
+
const {
|
|
323
|
+
program,
|
|
324
|
+
getName
|
|
325
|
+
} = await Tester.compile(t.code`
|
|
326
|
+
op ${t.op("getName")}(id: string): string;
|
|
327
|
+
`);
|
|
328
|
+
expect(getOutput(program, [_$createComponent(FunctionDeclaration, {
|
|
329
|
+
type: getName,
|
|
330
|
+
doc: ["First paragraph", "Second paragraph"]
|
|
331
|
+
})])).toRenderTo(`
|
|
332
|
+
def get_name(id: str) -> str:
|
|
333
|
+
"""
|
|
334
|
+
First paragraph
|
|
335
|
+
|
|
336
|
+
Second paragraph
|
|
337
|
+
"""
|
|
338
|
+
|
|
339
|
+
pass
|
|
340
|
+
|
|
341
|
+
`);
|
|
342
|
+
});
|
|
343
|
+
it("creates a function with doc as Children[]", async () => {
|
|
344
|
+
const {
|
|
345
|
+
program,
|
|
346
|
+
getName
|
|
347
|
+
} = await Tester.compile(t.code`
|
|
348
|
+
op ${t.op("getName")}(id: string): string;
|
|
349
|
+
`);
|
|
350
|
+
expect(getOutput(program, [_$createComponent(FunctionDeclaration, {
|
|
351
|
+
type: getName,
|
|
352
|
+
get doc() {
|
|
353
|
+
return [["First paragraph"], ["Second paragraph"]];
|
|
354
|
+
}
|
|
355
|
+
})])).toRenderTo(`
|
|
356
|
+
def get_name(id: str) -> str:
|
|
357
|
+
"""
|
|
358
|
+
First paragraph
|
|
359
|
+
|
|
360
|
+
Second paragraph
|
|
361
|
+
"""
|
|
362
|
+
|
|
363
|
+
pass
|
|
364
|
+
|
|
365
|
+
`);
|
|
366
|
+
});
|
|
367
|
+
it("creates a function with doc lines (string with newlines)", async () => {
|
|
368
|
+
const {
|
|
369
|
+
program,
|
|
370
|
+
getName
|
|
371
|
+
} = await Tester.compile(t.code`
|
|
372
|
+
op ${t.op("getName")}(id: string): string;
|
|
373
|
+
`);
|
|
374
|
+
expect(getOutput(program, [_$createComponent(FunctionDeclaration, {
|
|
375
|
+
type: getName,
|
|
376
|
+
doc: "Line 1\nLine 2"
|
|
377
|
+
})])).toRenderTo(`
|
|
378
|
+
def get_name(id: str) -> str:
|
|
379
|
+
"""
|
|
380
|
+
Line 1
|
|
381
|
+
Line 2
|
|
382
|
+
"""
|
|
383
|
+
|
|
384
|
+
pass
|
|
385
|
+
|
|
386
|
+
`);
|
|
387
|
+
});
|
|
388
|
+
it("creates a function with no parameters", async () => {
|
|
389
|
+
const {
|
|
390
|
+
program,
|
|
391
|
+
ping
|
|
392
|
+
} = await Tester.compile(t.code`
|
|
393
|
+
op ${t.op("ping")}(): string;
|
|
394
|
+
`);
|
|
395
|
+
expect(getOutput(program, [_$createComponent(FunctionDeclaration, {
|
|
396
|
+
type: ping
|
|
397
|
+
})])).toRenderTo(`
|
|
398
|
+
def ping() -> str:
|
|
399
|
+
pass
|
|
400
|
+
|
|
401
|
+
`);
|
|
402
|
+
});
|
|
403
|
+
it("creates a function that returns None for void", async () => {
|
|
404
|
+
const {
|
|
405
|
+
program,
|
|
406
|
+
ping
|
|
407
|
+
} = await Tester.compile(t.code`
|
|
408
|
+
op ${t.op("ping")}(): void;
|
|
409
|
+
`);
|
|
410
|
+
expect(getOutput(program, [_$createComponent(FunctionDeclaration, {
|
|
411
|
+
type: ping
|
|
412
|
+
})])).toRenderTo(`
|
|
413
|
+
def ping() -> None:
|
|
414
|
+
pass
|
|
415
|
+
|
|
416
|
+
`);
|
|
417
|
+
});
|
|
418
|
+
it("creates a function that returns Never for never", async () => {
|
|
419
|
+
const {
|
|
420
|
+
program,
|
|
421
|
+
abort
|
|
422
|
+
} = await Tester.compile(t.code`
|
|
423
|
+
op ${t.op("abort")}(): never;
|
|
424
|
+
`);
|
|
425
|
+
expect(getOutput(program, [_$createComponent(FunctionDeclaration, {
|
|
426
|
+
type: abort
|
|
427
|
+
})])).toRenderTo(`
|
|
428
|
+
from typing import Never
|
|
429
|
+
|
|
430
|
+
|
|
431
|
+
def abort() -> Never:
|
|
432
|
+
pass
|
|
433
|
+
|
|
434
|
+
`);
|
|
435
|
+
});
|
|
436
|
+
it("creates a function that correctly handles simple unions", async () => {
|
|
437
|
+
const {
|
|
438
|
+
program,
|
|
439
|
+
get
|
|
440
|
+
} = await Tester.compile(t.code`
|
|
441
|
+
op ${t.op("get")}(): int32 | string;
|
|
442
|
+
`);
|
|
443
|
+
expect(getOutput(program, [_$createComponent(FunctionDeclaration, {
|
|
444
|
+
type: get
|
|
445
|
+
})])).toRenderTo(`
|
|
446
|
+
def get() -> int | str:
|
|
447
|
+
pass
|
|
448
|
+
|
|
449
|
+
`);
|
|
450
|
+
});
|
|
451
|
+
it("creates a function with only keyword-only parameters (requires * marker for params with defaults)", async () => {
|
|
452
|
+
const {
|
|
453
|
+
program,
|
|
454
|
+
createPerson
|
|
455
|
+
} = await Tester.compile(t.code`
|
|
456
|
+
op ${t.op("createPerson")}(name: string = "alice", age: int32 = 30): string;
|
|
457
|
+
`);
|
|
458
|
+
expect(getOutput(program, [_$createComponent(FunctionDeclaration, {
|
|
459
|
+
type: createPerson
|
|
460
|
+
})])).toRenderTo(`
|
|
461
|
+
def create_person(*, name: str = "alice", age: int = 30) -> str:
|
|
462
|
+
pass
|
|
463
|
+
|
|
464
|
+
`);
|
|
465
|
+
});
|
|
466
|
+
it("creates a function with operation params positional and additional params keyword-only", async () => {
|
|
467
|
+
const {
|
|
468
|
+
program,
|
|
469
|
+
createPerson
|
|
470
|
+
} = await Tester.compile(t.code`
|
|
471
|
+
op ${t.op("createPerson")}(id: string, locale: string = "en-US"): string;
|
|
472
|
+
`);
|
|
473
|
+
expect(getOutput(program, [_$createComponent(FunctionDeclaration, {
|
|
474
|
+
type: createPerson,
|
|
475
|
+
get parameters() {
|
|
476
|
+
return [{
|
|
477
|
+
name: "version",
|
|
478
|
+
type: "int"
|
|
479
|
+
}, {
|
|
480
|
+
name: "debug",
|
|
481
|
+
type: "bool",
|
|
482
|
+
default: _$createComponent(py.Atom, {
|
|
483
|
+
jsValue: false
|
|
484
|
+
})
|
|
485
|
+
}];
|
|
486
|
+
}
|
|
487
|
+
})])).toRenderTo(`
|
|
488
|
+
def create_person(id: str, *, version: int, locale: str = "en-US", debug: bool = False) -> str:
|
|
489
|
+
pass
|
|
490
|
+
|
|
491
|
+
`);
|
|
492
|
+
});
|
|
493
|
+
it("creates a function with TSP params in wrong order (default before required) - reorders correctly", async () => {
|
|
494
|
+
const {
|
|
495
|
+
program,
|
|
496
|
+
createPerson
|
|
497
|
+
} = await Tester.compile(t.code`
|
|
498
|
+
op ${t.op("createPerson")}(locale: string = "en-US", id: string): string;
|
|
499
|
+
`);
|
|
500
|
+
expect(getOutput(program, [_$createComponent(FunctionDeclaration, {
|
|
501
|
+
type: createPerson
|
|
502
|
+
})])).toRenderTo(`
|
|
503
|
+
def create_person(id: str, *, locale: str = "en-US") -> str:
|
|
504
|
+
pass
|
|
505
|
+
|
|
506
|
+
`);
|
|
507
|
+
});
|
|
508
|
+
it("creates a function with only positional params when adding params to empty operation", async () => {
|
|
509
|
+
const {
|
|
510
|
+
program,
|
|
511
|
+
ping
|
|
512
|
+
} = await Tester.compile(t.code`
|
|
513
|
+
op ${t.op("ping")}(): string;
|
|
514
|
+
`);
|
|
515
|
+
expect(getOutput(program, [_$createComponent(FunctionDeclaration, {
|
|
516
|
+
type: ping,
|
|
517
|
+
parameters: ["name", "age"]
|
|
518
|
+
})])).toRenderTo(`
|
|
519
|
+
def ping(name, age) -> str:
|
|
520
|
+
pass
|
|
521
|
+
|
|
522
|
+
`);
|
|
523
|
+
});
|
|
524
|
+
it("creates a function with multiple positional params", async () => {
|
|
525
|
+
const {
|
|
526
|
+
program,
|
|
527
|
+
createPerson
|
|
528
|
+
} = await Tester.compile(t.code`
|
|
529
|
+
op ${t.op("createPerson")}(id: string, name: string, age: int32): string;
|
|
530
|
+
`);
|
|
531
|
+
expect(getOutput(program, [_$createComponent(FunctionDeclaration, {
|
|
532
|
+
type: createPerson
|
|
533
|
+
})])).toRenderTo(`
|
|
534
|
+
def create_person(id: str, name: str, age: int) -> str:
|
|
535
|
+
pass
|
|
536
|
+
|
|
537
|
+
`);
|
|
538
|
+
});
|
|
539
|
+
it("creates a function adding keyword-only params to operation with only positional params", async () => {
|
|
540
|
+
const {
|
|
541
|
+
program,
|
|
542
|
+
createPerson
|
|
543
|
+
} = await Tester.compile(t.code`
|
|
544
|
+
op ${t.op("createPerson")}(id: string, name: string): string;
|
|
545
|
+
`);
|
|
546
|
+
expect(getOutput(program, [_$createComponent(FunctionDeclaration, {
|
|
547
|
+
type: createPerson,
|
|
548
|
+
get parameters() {
|
|
549
|
+
return ["email", {
|
|
550
|
+
name: "notify",
|
|
551
|
+
type: "bool",
|
|
552
|
+
default: _$createComponent(py.Atom, {
|
|
553
|
+
jsValue: false
|
|
554
|
+
})
|
|
555
|
+
}];
|
|
556
|
+
}
|
|
557
|
+
})])).toRenderTo(`
|
|
558
|
+
def create_person(id: str, name: str, *, email, notify: bool = False) -> str:
|
|
559
|
+
pass
|
|
560
|
+
|
|
561
|
+
`);
|
|
562
|
+
});
|
|
563
|
+
it("creates a function with multiple params with defaults (all keyword-only)", async () => {
|
|
564
|
+
const {
|
|
565
|
+
program,
|
|
566
|
+
search
|
|
567
|
+
} = await Tester.compile(t.code`
|
|
568
|
+
op ${t.op("search")}(
|
|
569
|
+
limit: int32 = 10,
|
|
570
|
+
offset: int32 = 0,
|
|
571
|
+
sortBy: string = "name"
|
|
572
|
+
): string;
|
|
573
|
+
`);
|
|
574
|
+
expect(getOutput(program, [_$createComponent(FunctionDeclaration, {
|
|
575
|
+
type: search
|
|
576
|
+
})])).toRenderTo(`
|
|
577
|
+
def search(*, limit: int = 10, offset: int = 0, sort_by: str = "name") -> str:
|
|
578
|
+
pass
|
|
579
|
+
|
|
580
|
+
`);
|
|
581
|
+
});
|
|
582
|
+
it("creates a function adding params without defaults to operation with only defaults", async () => {
|
|
583
|
+
const {
|
|
584
|
+
program,
|
|
585
|
+
search
|
|
586
|
+
} = await Tester.compile(t.code`
|
|
587
|
+
op ${t.op("search")}(limit: int32 = 10, offset: int32 = 0): string;
|
|
588
|
+
`);
|
|
589
|
+
expect(getOutput(program, [_$createComponent(FunctionDeclaration, {
|
|
590
|
+
type: search,
|
|
591
|
+
parameters: ["query"]
|
|
592
|
+
})])).toRenderTo(`
|
|
593
|
+
def search(*, query, limit: int = 10, offset: int = 0) -> str:
|
|
594
|
+
pass
|
|
595
|
+
|
|
596
|
+
`);
|
|
597
|
+
});
|
|
598
|
+
it("creates a function with complex parameter mix", async () => {
|
|
599
|
+
const {
|
|
600
|
+
program,
|
|
601
|
+
complexOp
|
|
602
|
+
} = await Tester.compile(t.code`
|
|
603
|
+
op ${t.op("complexOp")}(
|
|
604
|
+
required1: string,
|
|
605
|
+
required2: int32,
|
|
606
|
+
optional1: string = "default",
|
|
607
|
+
optional2: int32 = 42
|
|
608
|
+
): string;
|
|
609
|
+
`);
|
|
610
|
+
expect(getOutput(program, [_$createComponent(FunctionDeclaration, {
|
|
611
|
+
type: complexOp,
|
|
612
|
+
get parameters() {
|
|
613
|
+
return ["additionalRequired", {
|
|
614
|
+
name: "additionalOptional",
|
|
615
|
+
type: "bool",
|
|
616
|
+
default: _$createComponent(py.Atom, {
|
|
617
|
+
jsValue: true
|
|
618
|
+
})
|
|
619
|
+
}];
|
|
620
|
+
}
|
|
621
|
+
})])).toRenderTo(`
|
|
622
|
+
def complex_op(required1: str, required2: int, *, additional_required, optional1: str = "default", optional2: int = 42, additional_optional: bool = True) -> str:
|
|
623
|
+
pass
|
|
624
|
+
|
|
625
|
+
`);
|
|
626
|
+
});
|
|
627
|
+
it("creates a function with single positional param and additional keyword-only", async () => {
|
|
628
|
+
const {
|
|
629
|
+
program,
|
|
630
|
+
getUser
|
|
631
|
+
} = await Tester.compile(t.code`
|
|
632
|
+
op ${t.op("getUser")}(id: string): string;
|
|
633
|
+
`);
|
|
634
|
+
expect(getOutput(program, [_$createComponent(FunctionDeclaration, {
|
|
635
|
+
type: getUser,
|
|
636
|
+
get parameters() {
|
|
637
|
+
return [{
|
|
638
|
+
name: "includeDeleted",
|
|
639
|
+
type: "bool",
|
|
640
|
+
default: _$createComponent(py.Atom, {
|
|
641
|
+
jsValue: false
|
|
642
|
+
})
|
|
643
|
+
}];
|
|
644
|
+
}
|
|
645
|
+
})])).toRenderTo(`
|
|
646
|
+
def get_user(id: str, *, include_deleted: bool = False) -> str:
|
|
647
|
+
pass
|
|
648
|
+
|
|
649
|
+
`);
|
|
650
|
+
});
|
|
651
|
+
it("creates a function adding only params with defaults to empty operation", async () => {
|
|
652
|
+
const {
|
|
653
|
+
program,
|
|
654
|
+
ping
|
|
655
|
+
} = await Tester.compile(t.code`
|
|
656
|
+
op ${t.op("ping")}(): string;
|
|
657
|
+
`);
|
|
658
|
+
expect(getOutput(program, [_$createComponent(FunctionDeclaration, {
|
|
659
|
+
type: ping,
|
|
660
|
+
get parameters() {
|
|
661
|
+
return [{
|
|
662
|
+
name: "timeout",
|
|
663
|
+
type: "int",
|
|
664
|
+
default: _$createComponent(py.Atom, {
|
|
665
|
+
jsValue: 30
|
|
666
|
+
})
|
|
667
|
+
}, {
|
|
668
|
+
name: "retries",
|
|
669
|
+
type: "int",
|
|
670
|
+
default: _$createComponent(py.Atom, {
|
|
671
|
+
jsValue: 3
|
|
672
|
+
})
|
|
673
|
+
}];
|
|
674
|
+
}
|
|
675
|
+
})])).toRenderTo(`
|
|
676
|
+
def ping(*, timeout: int = 30, retries: int = 3) -> str:
|
|
677
|
+
pass
|
|
678
|
+
|
|
679
|
+
`);
|
|
680
|
+
});
|
|
681
|
+
});
|
|
682
|
+
//# sourceMappingURL=function-declaration.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getOutput","Tester","py","t","describe","expect","it","FunctionDeclaration","program","getName","compile","code","op","_$createComponent","type","toRenderTo","async","name","createPerson","parameters","replaceParameters","default","Atom","jsValue","Foo","model","parametersModel","returnType","children","doc","FunctionDoc","description","ping","abort","get","search","complexOp","getUser"],"sources":["../../../../../src/python/components/function-declaration/function-declaration.test.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,SAAS,QAAQ,uBAAuB;AACjD,SAASC,MAAM,QAAQ,oBAAoB;AAC3C,OAAO,KAAKC,EAAE,MAAM,kBAAkB;AACtC,SAASC,CAAC,QAAQ,4BAA4B;AAC9C,SAASC,QAAQ,EA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