@alloy-js/python 0.5.0-dev.0 → 0.5.0-dev.2

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.
Files changed (276) hide show
  1. package/dist/dev/src/builtins/python.js +46 -0
  2. package/dist/dev/src/builtins/python.js.map +1 -1
  3. package/dist/dev/src/components/ClassDeclaration.js +19 -10
  4. package/dist/dev/src/components/ClassDeclaration.js.map +1 -1
  5. package/dist/dev/src/components/ClassMethodDeclaration.js +20 -5
  6. package/dist/dev/src/components/ClassMethodDeclaration.js.map +1 -1
  7. package/dist/dev/src/components/DataclassDeclaration.js +14 -12
  8. package/dist/dev/src/components/DataclassDeclaration.js.map +1 -1
  9. package/dist/dev/src/components/DecoratorList.js +55 -0
  10. package/dist/dev/src/components/DecoratorList.js.map +1 -0
  11. package/dist/dev/src/components/EnumDeclaration.js +21 -12
  12. package/dist/dev/src/components/EnumDeclaration.js.map +1 -1
  13. package/dist/dev/src/components/FunctionBase.js +21 -10
  14. package/dist/dev/src/components/FunctionBase.js.map +1 -1
  15. package/dist/dev/src/components/FutureStatement.js +1 -1
  16. package/dist/dev/src/components/MethodBase.js +16 -4
  17. package/dist/dev/src/components/MethodBase.js.map +1 -1
  18. package/dist/dev/src/components/PropertyDeclaration.js +68 -17
  19. package/dist/dev/src/components/PropertyDeclaration.js.map +1 -1
  20. package/dist/dev/src/components/PydanticClassDeclaration.js +136 -0
  21. package/dist/dev/src/components/PydanticClassDeclaration.js.map +1 -0
  22. package/dist/dev/src/components/SourceFile.js +44 -32
  23. package/dist/dev/src/components/SourceFile.js.map +1 -1
  24. package/dist/dev/src/components/StaticMethodDeclaration.js +19 -5
  25. package/dist/dev/src/components/StaticMethodDeclaration.js.map +1 -1
  26. package/dist/dev/src/components/index.js +1 -0
  27. package/dist/dev/src/components/index.js.map +1 -1
  28. package/dist/dev/test/callsignatures.test.js +471 -297
  29. package/dist/dev/test/callsignatures.test.js.map +1 -1
  30. package/dist/dev/test/class-method-declaration.test.js +21 -10
  31. package/dist/dev/test/class-method-declaration.test.js.map +1 -1
  32. package/dist/dev/test/classdeclarations.test.js +480 -381
  33. package/dist/dev/test/classdeclarations.test.js.map +1 -1
  34. package/dist/dev/test/classinstantiations.test.js +201 -168
  35. package/dist/dev/test/classinstantiations.test.js.map +1 -1
  36. package/dist/dev/test/constructordeclaration.test.js +22 -11
  37. package/dist/dev/test/constructordeclaration.test.js.map +1 -1
  38. package/dist/dev/test/dataclassdeclarations.test.js +345 -358
  39. package/dist/dev/test/dataclassdeclarations.test.js.map +1 -1
  40. package/dist/dev/test/decoratorlist.test.js +131 -0
  41. package/dist/dev/test/decoratorlist.test.js.map +1 -0
  42. package/dist/dev/test/dundermethoddeclaration.test.js +22 -11
  43. package/dist/dev/test/dundermethoddeclaration.test.js.map +1 -1
  44. package/dist/dev/test/enums.test.js +231 -166
  45. package/dist/dev/test/enums.test.js.map +1 -1
  46. package/dist/dev/test/externals.test.js +57 -45
  47. package/dist/dev/test/externals.test.js.map +1 -1
  48. package/dist/dev/test/factories.test.js +124 -50
  49. package/dist/dev/test/factories.test.js.map +1 -1
  50. package/dist/dev/test/functioncallexpressions.test.js +199 -164
  51. package/dist/dev/test/functioncallexpressions.test.js.map +1 -1
  52. package/dist/dev/test/functiondeclaration.test.js +452 -265
  53. package/dist/dev/test/functiondeclaration.test.js.map +1 -1
  54. package/dist/dev/test/imports.test.js +273 -221
  55. package/dist/dev/test/imports.test.js.map +1 -1
  56. package/dist/dev/test/memberexpressions.test.js +1237 -972
  57. package/dist/dev/test/memberexpressions.test.js.map +1 -1
  58. package/dist/dev/test/methoddeclaration.test.js +200 -45
  59. package/dist/dev/test/methoddeclaration.test.js.map +1 -1
  60. package/dist/dev/test/namepolicies.test.js +130 -94
  61. package/dist/dev/test/namepolicies.test.js.map +1 -1
  62. package/dist/dev/test/propertydeclaration.test.js +177 -46
  63. package/dist/dev/test/propertydeclaration.test.js.map +1 -1
  64. package/dist/dev/test/pydanticclassdeclarations.test.js +1089 -0
  65. package/dist/dev/test/pydanticclassdeclarations.test.js.map +1 -0
  66. package/dist/dev/test/pydocs.test.js +888 -715
  67. package/dist/dev/test/pydocs.test.js.map +1 -1
  68. package/dist/dev/test/references.test.js +42 -35
  69. package/dist/dev/test/references.test.js.map +1 -1
  70. package/dist/dev/test/sourcefiles.test.js +1109 -841
  71. package/dist/dev/test/sourcefiles.test.js.map +1 -1
  72. package/dist/dev/test/staticmethoddeclaration.test.js +21 -10
  73. package/dist/dev/test/staticmethoddeclaration.test.js.map +1 -1
  74. package/dist/dev/test/type-checking-imports.test.js +408 -359
  75. package/dist/dev/test/type-checking-imports.test.js.map +1 -1
  76. package/dist/dev/test/typereference.test.js +55 -40
  77. package/dist/dev/test/typereference.test.js.map +1 -1
  78. package/dist/dev/test/uniontypeexpression.test.js +222 -146
  79. package/dist/dev/test/uniontypeexpression.test.js.map +1 -1
  80. package/dist/dev/test/utils.js +39 -77
  81. package/dist/dev/test/utils.js.map +1 -1
  82. package/dist/dev/test/values.test.js +237 -101
  83. package/dist/dev/test/values.test.js.map +1 -1
  84. package/dist/dev/test/variables.test.js +321 -203
  85. package/dist/dev/test/variables.test.js.map +1 -1
  86. package/dist/dev/test/vitest.setup.js +2 -0
  87. package/dist/dev/test/vitest.setup.js.map +1 -0
  88. package/dist/src/builtins/python.d.ts +30 -0
  89. package/dist/src/builtins/python.d.ts.map +1 -1
  90. package/dist/src/builtins/python.js +46 -0
  91. package/dist/src/builtins/python.js.map +1 -1
  92. package/dist/src/components/ClassDeclaration.d.ts +21 -0
  93. package/dist/src/components/ClassDeclaration.d.ts.map +1 -1
  94. package/dist/src/components/ClassDeclaration.js +6 -1
  95. package/dist/src/components/ClassDeclaration.js.map +1 -1
  96. package/dist/src/components/ClassMethodDeclaration.d.ts +5 -1
  97. package/dist/src/components/ClassMethodDeclaration.d.ts.map +1 -1
  98. package/dist/src/components/ClassMethodDeclaration.js +14 -3
  99. package/dist/src/components/ClassMethodDeclaration.js.map +1 -1
  100. package/dist/src/components/DataclassDeclaration.d.ts.map +1 -1
  101. package/dist/src/components/DataclassDeclaration.js +10 -4
  102. package/dist/src/components/DataclassDeclaration.js.map +1 -1
  103. package/dist/src/components/DecoratorList.d.ts +43 -0
  104. package/dist/src/components/DecoratorList.d.ts.map +1 -0
  105. package/dist/src/components/DecoratorList.js +47 -0
  106. package/dist/src/components/DecoratorList.js.map +1 -0
  107. package/dist/src/components/EnumDeclaration.d.ts +9 -0
  108. package/dist/src/components/EnumDeclaration.d.ts.map +1 -1
  109. package/dist/src/components/EnumDeclaration.js +6 -1
  110. package/dist/src/components/EnumDeclaration.js.map +1 -1
  111. package/dist/src/components/FunctionBase.d.ts +31 -1
  112. package/dist/src/components/FunctionBase.d.ts.map +1 -1
  113. package/dist/src/components/FunctionBase.js +9 -2
  114. package/dist/src/components/FunctionBase.js.map +1 -1
  115. package/dist/src/components/FutureStatement.d.ts +1 -1
  116. package/dist/src/components/FutureStatement.js +1 -1
  117. package/dist/src/components/MethodBase.d.ts.map +1 -1
  118. package/dist/src/components/MethodBase.js +10 -2
  119. package/dist/src/components/MethodBase.js.map +1 -1
  120. package/dist/src/components/PropertyDeclaration.d.ts +29 -0
  121. package/dist/src/components/PropertyDeclaration.d.ts.map +1 -1
  122. package/dist/src/components/PropertyDeclaration.js +48 -1
  123. package/dist/src/components/PropertyDeclaration.js.map +1 -1
  124. package/dist/src/components/PydanticClassDeclaration.d.ts +120 -0
  125. package/dist/src/components/PydanticClassDeclaration.d.ts.map +1 -0
  126. package/dist/src/components/PydanticClassDeclaration.js +116 -0
  127. package/dist/src/components/PydanticClassDeclaration.js.map +1 -0
  128. package/dist/src/components/SourceFile.d.ts +2 -2
  129. package/dist/src/components/SourceFile.d.ts.map +1 -1
  130. package/dist/src/components/SourceFile.js +12 -0
  131. package/dist/src/components/SourceFile.js.map +1 -1
  132. package/dist/src/components/StaticMethodDeclaration.d.ts +3 -0
  133. package/dist/src/components/StaticMethodDeclaration.d.ts.map +1 -1
  134. package/dist/src/components/StaticMethodDeclaration.js +13 -3
  135. package/dist/src/components/StaticMethodDeclaration.js.map +1 -1
  136. package/dist/src/components/index.d.ts +1 -0
  137. package/dist/src/components/index.d.ts.map +1 -1
  138. package/dist/src/components/index.js +1 -0
  139. package/dist/src/components/index.js.map +1 -1
  140. package/dist/test/callsignatures.test.js +346 -272
  141. package/dist/test/callsignatures.test.js.map +1 -1
  142. package/dist/test/class-method-declaration.test.js +7 -4
  143. package/dist/test/class-method-declaration.test.js.map +1 -1
  144. package/dist/test/classdeclarations.test.js +316 -277
  145. package/dist/test/classdeclarations.test.js.map +1 -1
  146. package/dist/test/classinstantiations.test.js +112 -103
  147. package/dist/test/classinstantiations.test.js.map +1 -1
  148. package/dist/test/constructordeclaration.test.js +7 -4
  149. package/dist/test/constructordeclaration.test.js.map +1 -1
  150. package/dist/test/dataclassdeclarations.test.js +153 -178
  151. package/dist/test/dataclassdeclarations.test.js.map +1 -1
  152. package/dist/test/decoratorlist.test.d.ts +2 -0
  153. package/dist/test/decoratorlist.test.d.ts.map +1 -0
  154. package/dist/test/decoratorlist.test.js +83 -0
  155. package/dist/test/decoratorlist.test.js.map +1 -0
  156. package/dist/test/dundermethoddeclaration.test.js +7 -4
  157. package/dist/test/dundermethoddeclaration.test.js.map +1 -1
  158. package/dist/test/enums.test.js +172 -143
  159. package/dist/test/enums.test.js.map +1 -1
  160. package/dist/test/externals.test.js +24 -24
  161. package/dist/test/externals.test.js.map +1 -1
  162. package/dist/test/factories.test.js +75 -33
  163. package/dist/test/factories.test.js.map +1 -1
  164. package/dist/test/functioncallexpressions.test.js +117 -106
  165. package/dist/test/functioncallexpressions.test.js.map +1 -1
  166. package/dist/test/functiondeclaration.test.js +256 -173
  167. package/dist/test/functiondeclaration.test.js.map +1 -1
  168. package/dist/test/imports.test.js +171 -143
  169. package/dist/test/imports.test.js.map +1 -1
  170. package/dist/test/memberexpressions.test.js +582 -453
  171. package/dist/test/memberexpressions.test.js.map +1 -1
  172. package/dist/test/methoddeclaration.test.js +106 -19
  173. package/dist/test/methoddeclaration.test.js.map +1 -1
  174. package/dist/test/namepolicies.test.js +90 -78
  175. package/dist/test/namepolicies.test.js.map +1 -1
  176. package/dist/test/propertydeclaration.test.js +90 -15
  177. package/dist/test/propertydeclaration.test.js.map +1 -1
  178. package/dist/test/pydanticclassdeclarations.test.d.ts +2 -0
  179. package/dist/test/pydanticclassdeclarations.test.d.ts.map +1 -0
  180. package/dist/test/pydanticclassdeclarations.test.js +773 -0
  181. package/dist/test/pydanticclassdeclarations.test.js.map +1 -0
  182. package/dist/test/pydocs.test.js +573 -532
  183. package/dist/test/pydocs.test.js.map +1 -1
  184. package/dist/test/references.test.js +31 -28
  185. package/dist/test/references.test.js.map +1 -1
  186. package/dist/test/sourcefiles.test.js +700 -580
  187. package/dist/test/sourcefiles.test.js.map +1 -1
  188. package/dist/test/staticmethoddeclaration.test.js +7 -4
  189. package/dist/test/staticmethoddeclaration.test.js.map +1 -1
  190. package/dist/test/type-checking-imports.test.js +297 -284
  191. package/dist/test/type-checking-imports.test.js.map +1 -1
  192. package/dist/test/typereference.test.js +29 -22
  193. package/dist/test/typereference.test.js.map +1 -1
  194. package/dist/test/uniontypeexpression.test.js +124 -88
  195. package/dist/test/uniontypeexpression.test.js.map +1 -1
  196. package/dist/test/utils.d.ts +10 -17
  197. package/dist/test/utils.d.ts.map +1 -1
  198. package/dist/test/utils.js +32 -74
  199. package/dist/test/utils.js.map +1 -1
  200. package/dist/test/values.test.js +135 -67
  201. package/dist/test/values.test.js.map +1 -1
  202. package/dist/test/variables.test.js +201 -151
  203. package/dist/test/variables.test.js.map +1 -1
  204. package/dist/test/vitest.setup.d.ts +2 -0
  205. package/dist/test/vitest.setup.d.ts.map +1 -0
  206. package/dist/test/vitest.setup.js +2 -0
  207. package/dist/test/vitest.setup.js.map +1 -0
  208. package/dist/tsconfig.tsbuildinfo +1 -1
  209. package/docs/api/components/ClassDeclaration.md +10 -7
  210. package/docs/api/components/ClassEnumDeclaration.md +9 -6
  211. package/docs/api/components/ClassMethodDeclaration.md +7 -5
  212. package/docs/api/components/DataclassDeclaration.md +9 -5
  213. package/docs/api/components/DunderMethodDeclaration.md +7 -5
  214. package/docs/api/components/FunctionDeclaration.md +9 -5
  215. package/docs/api/components/FutureStatement.md +1 -1
  216. package/docs/api/components/MethodDeclaration.md +11 -6
  217. package/docs/api/components/PropertyDeclaration.md +11 -8
  218. package/docs/api/components/PydanticClassDeclaration.md +146 -0
  219. package/docs/api/components/SourceFile.md +20 -8
  220. package/docs/api/components/StaticMethodDeclaration.md +7 -5
  221. package/docs/api/components/index.md +1 -0
  222. package/docs/api/index.md +3 -3
  223. package/docs/api/types/CommonFunctionProps.md +4 -3
  224. package/docs/api/types/PydanticModelConfigDictProps.md +32 -0
  225. package/docs/api/types/index.md +1 -0
  226. package/docs/api/variables/index.md +3 -0
  227. package/docs/api/variables/pydanticModule.md +27 -0
  228. package/docs/api/variables/pydanticSettingsModule.md +7 -0
  229. package/docs/api/variables/typingModule.md +9 -0
  230. package/package.json +4 -4
  231. package/src/builtins/python.ts +539 -1
  232. package/src/components/ClassDeclaration.tsx +23 -0
  233. package/src/components/ClassMethodDeclaration.tsx +9 -1
  234. package/src/components/DataclassDeclaration.tsx +18 -11
  235. package/src/components/DecoratorList.tsx +50 -0
  236. package/src/components/EnumDeclaration.tsx +11 -0
  237. package/src/components/FunctionBase.tsx +34 -3
  238. package/src/components/FutureStatement.tsx +1 -1
  239. package/src/components/MethodBase.tsx +6 -2
  240. package/src/components/PropertyDeclaration.tsx +48 -1
  241. package/src/components/PydanticClassDeclaration.tsx +222 -0
  242. package/src/components/SourceFile.tsx +6 -1
  243. package/src/components/StaticMethodDeclaration.tsx +7 -1
  244. package/src/components/index.ts +1 -0
  245. package/temp/api.json +1158 -86
  246. package/test/callsignatures.test.tsx +309 -283
  247. package/test/class-method-declaration.test.tsx +3 -4
  248. package/test/classdeclarations.test.tsx +277 -235
  249. package/test/classinstantiations.test.tsx +115 -109
  250. package/test/constructordeclaration.test.tsx +9 -6
  251. package/test/dataclassdeclarations.test.tsx +256 -349
  252. package/test/decoratorlist.test.tsx +114 -0
  253. package/test/dundermethoddeclaration.test.tsx +3 -4
  254. package/test/enums.test.tsx +84 -71
  255. package/test/externals.test.tsx +25 -25
  256. package/test/factories.test.tsx +64 -22
  257. package/test/functioncallexpressions.test.tsx +123 -109
  258. package/test/functiondeclaration.test.tsx +218 -140
  259. package/test/imports.test.tsx +119 -91
  260. package/test/memberexpressions.test.tsx +265 -207
  261. package/test/methoddeclaration.test.tsx +115 -24
  262. package/test/namepolicies.test.tsx +69 -69
  263. package/test/propertydeclaration.test.tsx +71 -7
  264. package/test/pydanticclassdeclarations.test.tsx +704 -0
  265. package/test/pydocs.test.tsx +531 -579
  266. package/test/references.test.tsx +24 -23
  267. package/test/sourcefiles.test.tsx +527 -492
  268. package/test/staticmethoddeclaration.test.tsx +3 -4
  269. package/test/type-checking-imports.test.tsx +206 -218
  270. package/test/typereference.test.tsx +15 -12
  271. package/test/uniontypeexpression.test.tsx +74 -61
  272. package/test/utils.tsx +26 -110
  273. package/test/values.test.tsx +82 -32
  274. package/test/variables.test.tsx +162 -142
  275. package/test/vitest.setup.ts +1 -0
  276. package/vitest.config.ts +3 -0
@@ -1,30 +1,39 @@
1
- import { Prose, namekey, refkey } from "@alloy-js/core";
2
- import { d } from "@alloy-js/core/testing";
1
+ import { Prose, namekey, refkey, render } from "@alloy-js/core";
3
2
  import { describe, expect, it } from "vitest";
4
3
  import { dataclassesModule } from "../src/builtins/python.js";
5
4
  import * as py from "../src/index.js";
6
- import {
7
- assertFileContents,
8
- toSourceText,
9
- toSourceTextMultiple,
10
- } from "./utils.jsx";
5
+ import { TestOutput, TestOutputDirectory } from "./utils.js";
11
6
 
12
7
  describe("DataclassDeclaration", () => {
8
+ it("stacks user decorators above @dataclass", () => {
9
+ expect(
10
+ <TestOutput path="user.py" externals={[dataclassesModule]}>
11
+ <py.DataclassDeclaration name="User" frozen decorators={["@final"]} />
12
+ </TestOutput>,
13
+ ).toRenderTo(
14
+ `
15
+ from dataclasses import dataclass
16
+
17
+
18
+ @final
19
+ @dataclass(frozen=True)
20
+ class User:
21
+ pass
22
+
23
+ `,
24
+ );
25
+ });
26
+
13
27
  it("Creates a dataclass with a class doc", () => {
14
28
  const doc = (
15
29
  <py.ClassDoc description={[<Prose>Represents a user.</Prose>]} />
16
30
  );
17
- const res = toSourceText(
18
- [
19
- <py.SourceFile path="user.py">
20
- <py.DataclassDeclaration name="User" doc={doc} />
21
- </py.SourceFile>,
22
- ],
23
- { externals: [dataclassesModule] },
24
- );
25
-
26
- expect(res).toRenderTo(
27
- d`
31
+ expect(
32
+ <TestOutput path="user.py" externals={[dataclassesModule]}>
33
+ <py.DataclassDeclaration name="User" doc={doc} />
34
+ </TestOutput>,
35
+ ).toRenderTo(
36
+ `
28
37
  from dataclasses import dataclass
29
38
 
30
39
 
@@ -36,42 +45,36 @@ describe("DataclassDeclaration", () => {
36
45
 
37
46
  pass
38
47
 
39
-
40
48
  `,
41
49
  );
42
50
  });
43
51
 
44
52
  it("Creates a dataclass with fields and defaults", () => {
45
- const res = toSourceText(
46
- [
47
- <py.SourceFile path="user.py">
48
- <py.DataclassDeclaration name="User">
49
- <py.VariableDeclaration
50
- instanceVariable
51
- omitNone
52
- name="id"
53
- type="int"
54
- />
55
- <py.VariableDeclaration
56
- instanceVariable
57
- name={namekey("_", { ignoreNamePolicy: true })}
58
- type={dataclassesModule["."].KW_ONLY}
59
- omitNone
60
- />
61
- <py.VariableDeclaration
62
- instanceVariable
63
- name="name"
64
- type="str"
65
- initializer={"Anonymous"}
66
- />
67
- </py.DataclassDeclaration>
68
- </py.SourceFile>,
69
- ],
70
- { externals: [dataclassesModule] },
71
- );
72
-
73
- expect(res).toRenderTo(
74
- d`
53
+ expect(
54
+ <TestOutput path="user.py" externals={[dataclassesModule]}>
55
+ <py.DataclassDeclaration name="User">
56
+ <py.VariableDeclaration
57
+ instanceVariable
58
+ omitNone
59
+ name="id"
60
+ type="int"
61
+ />
62
+ <py.VariableDeclaration
63
+ instanceVariable
64
+ name={namekey("_", { ignoreNamePolicy: true })}
65
+ type={dataclassesModule["."].KW_ONLY}
66
+ omitNone
67
+ />
68
+ <py.VariableDeclaration
69
+ instanceVariable
70
+ name="name"
71
+ type="str"
72
+ initializer={"Anonymous"}
73
+ />
74
+ </py.DataclassDeclaration>
75
+ </TestOutput>,
76
+ ).toRenderTo(
77
+ `
75
78
  from dataclasses import dataclass
76
79
  from typing import TYPE_CHECKING
77
80
 
@@ -85,30 +88,24 @@ describe("DataclassDeclaration", () => {
85
88
  _: KW_ONLY
86
89
  name: str = "Anonymous"
87
90
 
88
-
89
91
  `,
90
92
  );
91
93
  });
92
94
 
93
95
  it("Creates a dataclass with keyword arguments", () => {
94
- const res = toSourceText(
95
- [
96
- <py.SourceFile path="user.py">
97
- <py.DataclassDeclaration name="User" frozen slots kwOnly>
98
- <py.VariableDeclaration
99
- instanceVariable
100
- omitNone
101
- name="id"
102
- type="int"
103
- />
104
- </py.DataclassDeclaration>
105
- </py.SourceFile>,
106
- ],
107
- { externals: [dataclassesModule] },
108
- );
109
-
110
- expect(res).toRenderTo(
111
- d`
96
+ expect(
97
+ <TestOutput path="user.py" externals={[dataclassesModule]}>
98
+ <py.DataclassDeclaration name="User" frozen slots kwOnly>
99
+ <py.VariableDeclaration
100
+ instanceVariable
101
+ omitNone
102
+ name="id"
103
+ type="int"
104
+ />
105
+ </py.DataclassDeclaration>
106
+ </TestOutput>,
107
+ ).toRenderTo(
108
+ `
112
109
  from dataclasses import dataclass
113
110
 
114
111
 
@@ -116,35 +113,29 @@ describe("DataclassDeclaration", () => {
116
113
  class User:
117
114
  id: int
118
115
 
119
-
120
116
  `,
121
117
  );
122
118
  });
123
119
 
124
120
  it("Creates a dataclass with all keyword arguments", () => {
125
- const res = toSourceText(
126
- [
127
- <py.SourceFile path="user.py">
128
- <py.DataclassDeclaration
129
- name="User"
130
- init
131
- repr={false}
132
- eq
133
- order={false}
134
- unsafeHash
135
- frozen
136
- matchArgs={false}
137
- kwOnly
138
- slots
139
- weakrefSlot={false}
140
- />
141
- </py.SourceFile>,
142
- ],
143
- { externals: [dataclassesModule] },
144
- );
145
-
146
- expect(res).toRenderTo(
147
- d`
121
+ expect(
122
+ <TestOutput path="user.py" externals={[dataclassesModule]}>
123
+ <py.DataclassDeclaration
124
+ name="User"
125
+ init
126
+ repr={false}
127
+ eq
128
+ order={false}
129
+ unsafeHash
130
+ frozen
131
+ matchArgs={false}
132
+ kwOnly
133
+ slots
134
+ weakrefSlot={false}
135
+ />
136
+ </TestOutput>,
137
+ ).toRenderTo(
138
+ `
148
139
  from dataclasses import dataclass
149
140
 
150
141
 
@@ -152,20 +143,16 @@ describe("DataclassDeclaration", () => {
152
143
  class User:
153
144
  pass
154
145
 
155
-
156
146
  `,
157
147
  );
158
148
  });
159
149
 
160
150
  it("Throws error when weakref_slot=True without slots=True", () => {
161
151
  expect(() =>
162
- toSourceText(
163
- [
164
- <py.SourceFile path="user.py">
165
- <py.DataclassDeclaration name="User" weakrefSlot />
166
- </py.SourceFile>,
167
- ],
168
- { externals: [dataclassesModule] },
152
+ render(
153
+ <TestOutput path="user.py" externals={[dataclassesModule]}>
154
+ <py.DataclassDeclaration name="User" weakrefSlot />
155
+ </TestOutput>,
169
156
  ),
170
157
  ).toThrowError(
171
158
  /weakref_slot=True requires slots=True in @dataclass decorator/,
@@ -173,16 +160,12 @@ describe("DataclassDeclaration", () => {
173
160
  });
174
161
 
175
162
  it("Allows weakref_slot=True when slots=True", () => {
176
- const res = toSourceText(
177
- [
178
- <py.SourceFile path="user.py">
179
- <py.DataclassDeclaration name="User" slots weakrefSlot />
180
- </py.SourceFile>,
181
- ],
182
- { externals: [dataclassesModule] },
183
- );
184
- expect(res).toRenderTo(
185
- d`
163
+ expect(
164
+ <TestOutput path="user.py" externals={[dataclassesModule]}>
165
+ <py.DataclassDeclaration name="User" slots weakrefSlot />
166
+ </TestOutput>,
167
+ ).toRenderTo(
168
+ `
186
169
  from dataclasses import dataclass
187
170
 
188
171
 
@@ -190,35 +173,27 @@ describe("DataclassDeclaration", () => {
190
173
  class User:
191
174
  pass
192
175
 
193
-
194
176
  `,
195
177
  );
196
178
  });
197
179
 
198
180
  it("Throws error when order=True and eq=False", () => {
199
181
  expect(() =>
200
- toSourceText(
201
- [
202
- <py.SourceFile path="user.py">
203
- <py.DataclassDeclaration name="User" order eq={false} />
204
- </py.SourceFile>,
205
- ],
206
- { externals: [dataclassesModule] },
182
+ render(
183
+ <TestOutput path="user.py" externals={[dataclassesModule]}>
184
+ <py.DataclassDeclaration name="User" order eq={false} />
185
+ </TestOutput>,
207
186
  ),
208
187
  ).toThrowError(/order=True requires eq=True/);
209
188
  });
210
189
 
211
190
  it("Creates a dataclass with order=True and no conflicting methods", () => {
212
- const res = toSourceText(
213
- [
214
- <py.SourceFile path="user.py">
215
- <py.DataclassDeclaration name="User" order />
216
- </py.SourceFile>,
217
- ],
218
- { externals: [dataclassesModule] },
219
- );
220
- expect(res).toRenderTo(
221
- d`
191
+ expect(
192
+ <TestOutput path="user.py" externals={[dataclassesModule]}>
193
+ <py.DataclassDeclaration name="User" order />
194
+ </TestOutput>,
195
+ ).toRenderTo(
196
+ `
222
197
  from dataclasses import dataclass
223
198
 
224
199
 
@@ -226,22 +201,18 @@ describe("DataclassDeclaration", () => {
226
201
  class User:
227
202
  pass
228
203
 
229
-
230
204
  `,
231
205
  );
232
206
  });
233
207
 
234
208
  it("Throws error when order=True and class defines __lt__", () => {
235
209
  expect(() =>
236
- toSourceText(
237
- [
238
- <py.SourceFile path="user.py">
239
- <py.DataclassDeclaration name="User" order>
240
- <py.DunderMethodDeclaration name="__lt__" />
241
- </py.DataclassDeclaration>
242
- </py.SourceFile>,
243
- ],
244
- { externals: [dataclassesModule] },
210
+ render(
211
+ <TestOutput path="user.py" externals={[dataclassesModule]}>
212
+ <py.DataclassDeclaration name="User" order>
213
+ <py.DunderMethodDeclaration name="__lt__" />
214
+ </py.DataclassDeclaration>
215
+ </TestOutput>,
245
216
  ),
246
217
  ).toThrowError(
247
218
  /Cannot specify order=True when the class already defines __lt__\(\)/,
@@ -250,15 +221,12 @@ describe("DataclassDeclaration", () => {
250
221
 
251
222
  it("Throws error when order=True and class defines __le__", () => {
252
223
  expect(() =>
253
- toSourceText(
254
- [
255
- <py.SourceFile path="user.py">
256
- <py.DataclassDeclaration name="User" order>
257
- <py.DunderMethodDeclaration name="__le__" />
258
- </py.DataclassDeclaration>
259
- </py.SourceFile>,
260
- ],
261
- { externals: [dataclassesModule] },
224
+ render(
225
+ <TestOutput path="user.py" externals={[dataclassesModule]}>
226
+ <py.DataclassDeclaration name="User" order>
227
+ <py.DunderMethodDeclaration name="__le__" />
228
+ </py.DataclassDeclaration>
229
+ </TestOutput>,
262
230
  ),
263
231
  ).toThrowError(
264
232
  /Cannot specify order=True when the class already defines __le__\(\)/,
@@ -267,15 +235,12 @@ describe("DataclassDeclaration", () => {
267
235
 
268
236
  it("Throws error when order=True and class defines __gt__", () => {
269
237
  expect(() =>
270
- toSourceText(
271
- [
272
- <py.SourceFile path="user.py">
273
- <py.DataclassDeclaration name="User" order>
274
- <py.DunderMethodDeclaration name="__gt__" />
275
- </py.DataclassDeclaration>
276
- </py.SourceFile>,
277
- ],
278
- { externals: [dataclassesModule] },
238
+ render(
239
+ <TestOutput path="user.py" externals={[dataclassesModule]}>
240
+ <py.DataclassDeclaration name="User" order>
241
+ <py.DunderMethodDeclaration name="__gt__" />
242
+ </py.DataclassDeclaration>
243
+ </TestOutput>,
279
244
  ),
280
245
  ).toThrowError(
281
246
  /Cannot specify order=True when the class already defines __gt__\(\)/,
@@ -284,15 +249,12 @@ describe("DataclassDeclaration", () => {
284
249
 
285
250
  it("Throws error when order=True and class defines __ge__", () => {
286
251
  expect(() =>
287
- toSourceText(
288
- [
289
- <py.SourceFile path="user.py">
290
- <py.DataclassDeclaration name="User" order>
291
- <py.DunderMethodDeclaration name="__ge__" />
292
- </py.DataclassDeclaration>
293
- </py.SourceFile>,
294
- ],
295
- { externals: [dataclassesModule] },
252
+ render(
253
+ <TestOutput path="user.py" externals={[dataclassesModule]}>
254
+ <py.DataclassDeclaration name="User" order>
255
+ <py.DunderMethodDeclaration name="__ge__" />
256
+ </py.DataclassDeclaration>
257
+ </TestOutput>,
296
258
  ),
297
259
  ).toThrowError(
298
260
  /Cannot specify order=True when the class already defines __ge__\(\)/,
@@ -304,15 +266,12 @@ describe("DataclassDeclaration", () => {
304
266
  return <py.DunderMethodDeclaration name="__lt__" />;
305
267
  }
306
268
  expect(() =>
307
- toSourceText(
308
- [
309
- <py.SourceFile path="user.py">
310
- <py.DataclassDeclaration name="User" order>
311
- <Wrapper />
312
- </py.DataclassDeclaration>
313
- </py.SourceFile>,
314
- ],
315
- { externals: [dataclassesModule] },
269
+ render(
270
+ <TestOutput path="user.py" externals={[dataclassesModule]}>
271
+ <py.DataclassDeclaration name="User" order>
272
+ <Wrapper />
273
+ </py.DataclassDeclaration>
274
+ </TestOutput>,
316
275
  ),
317
276
  ).toThrowError(
318
277
  /Cannot specify order=True when the class already defines __lt__\(\)/,
@@ -321,15 +280,12 @@ describe("DataclassDeclaration", () => {
321
280
 
322
281
  it("Throws error when unsafe_hash=True and class defines __hash__", () => {
323
282
  expect(() =>
324
- toSourceText(
325
- [
326
- <py.SourceFile path="user.py">
327
- <py.DataclassDeclaration name="User" unsafeHash>
328
- <py.DunderMethodDeclaration name="__hash__" />
329
- </py.DataclassDeclaration>
330
- </py.SourceFile>,
331
- ],
332
- { externals: [dataclassesModule] },
283
+ render(
284
+ <TestOutput path="user.py" externals={[dataclassesModule]}>
285
+ <py.DataclassDeclaration name="User" unsafeHash>
286
+ <py.DunderMethodDeclaration name="__hash__" />
287
+ </py.DataclassDeclaration>
288
+ </TestOutput>,
333
289
  ),
334
290
  ).toThrowError(
335
291
  /Cannot specify unsafe_hash=True when the class already defines __hash__\(\)/,
@@ -338,15 +294,12 @@ describe("DataclassDeclaration", () => {
338
294
 
339
295
  it("Throws error when frozen=True and class defines __setattr__", () => {
340
296
  expect(() =>
341
- toSourceText(
342
- [
343
- <py.SourceFile path="user.py">
344
- <py.DataclassDeclaration name="User" frozen>
345
- <py.DunderMethodDeclaration name="__setattr__" />
346
- </py.DataclassDeclaration>
347
- </py.SourceFile>,
348
- ],
349
- { externals: [dataclassesModule] },
297
+ render(
298
+ <TestOutput path="user.py" externals={[dataclassesModule]}>
299
+ <py.DataclassDeclaration name="User" frozen>
300
+ <py.DunderMethodDeclaration name="__setattr__" />
301
+ </py.DataclassDeclaration>
302
+ </TestOutput>,
350
303
  ),
351
304
  ).toThrowError(
352
305
  /Cannot specify frozen=True when the class already defines __setattr__\(\)/,
@@ -355,15 +308,12 @@ describe("DataclassDeclaration", () => {
355
308
 
356
309
  it("Throws errorwhen frozen=True and class defines __delattr__", () => {
357
310
  expect(() =>
358
- toSourceText(
359
- [
360
- <py.SourceFile path="user.py">
361
- <py.DataclassDeclaration name="User" frozen>
362
- <py.DunderMethodDeclaration name="__delattr__" />
363
- </py.DataclassDeclaration>
364
- </py.SourceFile>,
365
- ],
366
- { externals: [dataclassesModule] },
311
+ render(
312
+ <TestOutput path="user.py" externals={[dataclassesModule]}>
313
+ <py.DataclassDeclaration name="User" frozen>
314
+ <py.DunderMethodDeclaration name="__delattr__" />
315
+ </py.DataclassDeclaration>
316
+ </TestOutput>,
367
317
  ),
368
318
  ).toThrowError(
369
319
  /Cannot specify frozen=True when the class already defines __delattr__\(\)/,
@@ -372,15 +322,12 @@ describe("DataclassDeclaration", () => {
372
322
 
373
323
  it("Throws error when slots=True and class defines __slots__", () => {
374
324
  expect(() =>
375
- toSourceText(
376
- [
377
- <py.SourceFile path="user.py">
378
- <py.DataclassDeclaration name="User" slots>
379
- <py.DunderMethodDeclaration name="__slots__" />
380
- </py.DataclassDeclaration>
381
- </py.SourceFile>,
382
- ],
383
- { externals: [dataclassesModule] },
325
+ render(
326
+ <TestOutput path="user.py" externals={[dataclassesModule]}>
327
+ <py.DataclassDeclaration name="User" slots>
328
+ <py.DunderMethodDeclaration name="__slots__" />
329
+ </py.DataclassDeclaration>
330
+ </TestOutput>,
384
331
  ),
385
332
  ).toThrowError(
386
333
  /Cannot specify slots=True when the class already defines __slots__\(\)/,
@@ -388,23 +335,19 @@ describe("DataclassDeclaration", () => {
388
335
  });
389
336
 
390
337
  it("Creates a dataclass with kw_only=True on decorator (sentinel not used)", () => {
391
- const res = toSourceText(
392
- [
393
- <py.SourceFile path="user.py">
394
- <py.DataclassDeclaration name="User" kwOnly>
395
- <py.VariableDeclaration
396
- instanceVariable
397
- omitNone
398
- name="id"
399
- type="int"
400
- />
401
- </py.DataclassDeclaration>
402
- </py.SourceFile>,
403
- ],
404
- { externals: [dataclassesModule] },
405
- );
406
- expect(res).toRenderTo(
407
- d`
338
+ expect(
339
+ <TestOutput path="user.py" externals={[dataclassesModule]}>
340
+ <py.DataclassDeclaration name="User" kwOnly>
341
+ <py.VariableDeclaration
342
+ instanceVariable
343
+ omitNone
344
+ name="id"
345
+ type="int"
346
+ />
347
+ </py.DataclassDeclaration>
348
+ </TestOutput>,
349
+ ).toRenderTo(
350
+ `
408
351
  from dataclasses import dataclass
409
352
 
410
353
 
@@ -412,23 +355,17 @@ describe("DataclassDeclaration", () => {
412
355
  class User:
413
356
  id: int
414
357
 
415
-
416
358
  `,
417
359
  );
418
360
  });
419
361
 
420
362
  it("Creates a dataclass with base classes", () => {
421
- const res = toSourceText(
422
- [
423
- <py.SourceFile path="user.py">
424
- <py.DataclassDeclaration name="User" bases={["Base"]} />
425
- </py.SourceFile>,
426
- ],
427
- { externals: [dataclassesModule] },
428
- );
429
-
430
- expect(res).toRenderTo(
431
- d`
363
+ expect(
364
+ <TestOutput path="user.py" externals={[dataclassesModule]}>
365
+ <py.DataclassDeclaration name="User" bases={["Base"]} />
366
+ </TestOutput>,
367
+ ).toRenderTo(
368
+ `
432
369
  from dataclasses import dataclass
433
370
 
434
371
 
@@ -436,82 +373,68 @@ describe("DataclassDeclaration", () => {
436
373
  class User(Base):
437
374
  pass
438
375
 
439
-
440
376
  `,
441
377
  );
442
378
  });
443
379
 
444
380
  it("Throws error when more than one KW_ONLY sentinel is present", () => {
445
381
  expect(() =>
446
- toSourceText(
447
- [
448
- <py.SourceFile path="user.py">
449
- <py.DataclassDeclaration name="User">
450
- <py.VariableDeclaration
451
- instanceVariable
452
- name={namekey("_", { ignoreNamePolicy: true })}
453
- type={dataclassesModule["."].KW_ONLY}
454
- omitNone
455
- />
456
- <py.VariableDeclaration
457
- instanceVariable
458
- name={namekey("_", { ignoreNamePolicy: true })}
459
- type={dataclassesModule["."].KW_ONLY}
460
- omitNone
461
- />
462
- </py.DataclassDeclaration>
463
- </py.SourceFile>,
464
- ],
465
- { externals: [dataclassesModule] },
382
+ render(
383
+ <TestOutput path="user.py" externals={[dataclassesModule]}>
384
+ <py.DataclassDeclaration name="User">
385
+ <py.VariableDeclaration
386
+ instanceVariable
387
+ name={namekey("_", { ignoreNamePolicy: true })}
388
+ type={dataclassesModule["."].KW_ONLY}
389
+ omitNone
390
+ />
391
+ <py.VariableDeclaration
392
+ instanceVariable
393
+ name={namekey("_", { ignoreNamePolicy: true })}
394
+ type={dataclassesModule["."].KW_ONLY}
395
+ omitNone
396
+ />
397
+ </py.DataclassDeclaration>
398
+ </TestOutput>,
466
399
  ),
467
400
  ).toThrowError(/Only one KW_ONLY sentinel is allowed per dataclass body/);
468
401
  });
469
402
 
470
403
  it("Will raise arg validation errors first over member conflicts", () => {
471
404
  expect(() =>
472
- toSourceText(
473
- [
474
- <py.SourceFile path="user.py">
475
- <py.DataclassDeclaration name="User" order eq={false}>
476
- <py.DunderMethodDeclaration name="__lt__" />
477
- </py.DataclassDeclaration>
478
- </py.SourceFile>,
479
- ],
480
- { externals: [dataclassesModule] },
405
+ render(
406
+ <TestOutput path="user.py" externals={[dataclassesModule]}>
407
+ <py.DataclassDeclaration name="User" order eq={false}>
408
+ <py.DunderMethodDeclaration name="__lt__" />
409
+ </py.DataclassDeclaration>
410
+ </TestOutput>,
481
411
  ),
482
412
  ).toThrowError(/order=True requires eq=True/);
483
413
  });
484
414
 
485
415
  it("Does not raise errors for member conflict checks without the equivalent kwargs", () => {
486
416
  expect(() =>
487
- toSourceText(
488
- [
489
- <py.SourceFile path="user.py">
490
- <py.DataclassDeclaration name="User">
491
- <py.DunderMethodDeclaration name="__lt__" />
492
- <py.DunderMethodDeclaration name="__slots__" />
493
- <py.DunderMethodDeclaration name="__hash__" />
494
- <py.DunderMethodDeclaration name="__setattr__" />
495
- <py.DunderMethodDeclaration name="__delattr__" />
496
- </py.DataclassDeclaration>
497
- </py.SourceFile>,
498
- ],
499
- { externals: [dataclassesModule] },
417
+ render(
418
+ <TestOutput path="user.py" externals={[dataclassesModule]}>
419
+ <py.DataclassDeclaration name="User">
420
+ <py.DunderMethodDeclaration name="__lt__" />
421
+ <py.DunderMethodDeclaration name="__slots__" />
422
+ <py.DunderMethodDeclaration name="__hash__" />
423
+ <py.DunderMethodDeclaration name="__setattr__" />
424
+ <py.DunderMethodDeclaration name="__delattr__" />
425
+ </py.DataclassDeclaration>
426
+ </TestOutput>,
500
427
  ),
501
428
  ).not.toThrow();
502
429
  });
503
430
 
504
431
  it("Allows unsafe_hash=True when no __hash__ is defined", () => {
505
- const res = toSourceText(
506
- [
507
- <py.SourceFile path="user.py">
508
- <py.DataclassDeclaration name="User" unsafeHash />
509
- </py.SourceFile>,
510
- ],
511
- { externals: [dataclassesModule] },
512
- );
513
- expect(res).toRenderTo(
514
- d`
432
+ expect(
433
+ <TestOutput path="user.py" externals={[dataclassesModule]}>
434
+ <py.DataclassDeclaration name="User" unsafeHash />
435
+ </TestOutput>,
436
+ ).toRenderTo(
437
+ `
515
438
  from dataclasses import dataclass
516
439
 
517
440
 
@@ -519,7 +442,6 @@ describe("DataclassDeclaration", () => {
519
442
  class User:
520
443
  pass
521
444
 
522
-
523
445
  `,
524
446
  );
525
447
  });
@@ -536,36 +458,29 @@ describe("DataclassDeclaration", () => {
536
458
  );
537
459
  }
538
460
  expect(() =>
539
- toSourceText(
540
- [
541
- <py.SourceFile path="user.py">
542
- <py.DataclassDeclaration name="User">
543
- <py.VariableDeclaration
544
- instanceVariable
545
- name={namekey("_", { ignoreNamePolicy: true })}
546
- type={dataclassesModule["."].KW_ONLY}
547
- omitNone
548
- />
549
- <Wrapper />
550
- </py.DataclassDeclaration>
551
- </py.SourceFile>,
552
- ],
553
- { externals: [dataclassesModule] },
461
+ render(
462
+ <TestOutput path="user.py" externals={[dataclassesModule]}>
463
+ <py.DataclassDeclaration name="User">
464
+ <py.VariableDeclaration
465
+ instanceVariable
466
+ name={namekey("_", { ignoreNamePolicy: true })}
467
+ type={dataclassesModule["."].KW_ONLY}
468
+ omitNone
469
+ />
470
+ <Wrapper />
471
+ </py.DataclassDeclaration>
472
+ </TestOutput>,
554
473
  ),
555
474
  ).toThrowError(/Only one KW_ONLY sentinel is allowed per dataclass body/);
556
475
  });
557
476
 
558
477
  it("Allows frozen=True when no conflicting dunders exist", () => {
559
- const res = toSourceText(
560
- [
561
- <py.SourceFile path="user.py">
562
- <py.DataclassDeclaration name="User" frozen />
563
- </py.SourceFile>,
564
- ],
565
- { externals: [dataclassesModule] },
566
- );
567
- expect(res).toRenderTo(
568
- d`
478
+ expect(
479
+ <TestOutput path="user.py" externals={[dataclassesModule]}>
480
+ <py.DataclassDeclaration name="User" frozen />
481
+ </TestOutput>,
482
+ ).toRenderTo(
483
+ `
569
484
  from dataclasses import dataclass
570
485
 
571
486
 
@@ -573,22 +488,17 @@ describe("DataclassDeclaration", () => {
573
488
  class User:
574
489
  pass
575
490
 
576
-
577
491
  `,
578
492
  );
579
493
  });
580
494
 
581
495
  it("Allows slots=True when no __slots__ is defined", () => {
582
- const res = toSourceText(
583
- [
584
- <py.SourceFile path="user.py">
585
- <py.DataclassDeclaration name="User" slots />
586
- </py.SourceFile>,
587
- ],
588
- { externals: [dataclassesModule] },
589
- );
590
- expect(res).toRenderTo(
591
- d`
496
+ expect(
497
+ <TestOutput path="user.py" externals={[dataclassesModule]}>
498
+ <py.DataclassDeclaration name="User" slots />
499
+ </TestOutput>,
500
+ ).toRenderTo(
501
+ `
592
502
  from dataclasses import dataclass
593
503
 
594
504
 
@@ -596,15 +506,14 @@ describe("DataclassDeclaration", () => {
596
506
  class User:
597
507
  pass
598
508
 
599
-
600
509
  `,
601
510
  );
602
511
  });
603
512
 
604
513
  it("Forwards refkey prop for symbol resolution in type references", () => {
605
514
  const userRefkey = refkey();
606
- const res = toSourceTextMultiple(
607
- [
515
+ expect(
516
+ <TestOutputDirectory externals={[dataclassesModule]}>
608
517
  <py.SourceFile path="models.py">
609
518
  <py.DataclassDeclaration name="User" refkey={userRefkey}>
610
519
  <py.VariableDeclaration
@@ -620,7 +529,7 @@ describe("DataclassDeclaration", () => {
620
529
  type="str"
621
530
  />
622
531
  </py.DataclassDeclaration>
623
- </py.SourceFile>,
532
+ </py.SourceFile>
624
533
  <py.SourceFile path="services.py">
625
534
  <py.FunctionDeclaration name="get_user" returnType={userRefkey}>
626
535
  <py.VariableDeclaration
@@ -636,30 +545,28 @@ describe("DataclassDeclaration", () => {
636
545
  <hbr />
637
546
  {"return user"}
638
547
  </py.FunctionDeclaration>
639
- </py.SourceFile>,
640
- ],
641
- { externals: [dataclassesModule] },
642
- );
643
- assertFileContents(res, {
548
+ </py.SourceFile>
549
+ </TestOutputDirectory>,
550
+ ).toRenderTo({
644
551
  "models.py": `
645
- from dataclasses import dataclass
552
+ from dataclasses import dataclass
646
553
 
647
554
 
648
- @dataclass
649
- class User:
650
- id: int
651
- name: str
555
+ @dataclass
556
+ class User:
557
+ id: int
558
+ name: str
652
559
 
653
- `,
560
+ `,
654
561
  "services.py": `
655
- from models import User
562
+ from models import User
656
563
 
657
564
 
658
- def get_user() -> User:
659
- user: User = User(1, "Alice")
660
- return user
565
+ def get_user() -> User:
566
+ user: User = User(1, "Alice")
567
+ return user
661
568
 
662
- `,
569
+ `,
663
570
  });
664
571
  });
665
572
  });