robotframework 6.1rc1__zip → 7.0__zip

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 (307) hide show
  1. {robotframework-6.1rc1 → robotframework-7.0}/INSTALL.rst +25 -25
  2. {robotframework-6.1rc1 → robotframework-7.0}/PKG-INFO +6 -8
  3. {robotframework-6.1rc1 → robotframework-7.0}/README.rst +3 -2
  4. {robotframework-6.1rc1 → robotframework-7.0}/setup.py +3 -6
  5. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/api/__init__.py +4 -1
  6. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/api/deco.py +60 -14
  7. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/api/exceptions.py +6 -6
  8. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/api/interfaces.py +403 -68
  9. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/api/logger.py +27 -20
  10. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/api/parsing.py +4 -2
  11. robotframework-7.0/src/robot/api/py.typed +0 -0
  12. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/conf/gatherfailed.py +2 -2
  13. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/conf/languages.py +61 -25
  14. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/conf/settings.py +21 -14
  15. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/common/storage.js +11 -6
  16. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/htmlfilewriter.py +1 -1
  17. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/libdoc/libdoc.css +10 -2
  18. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/libdoc/libdoc.html +10 -0
  19. robotframework-7.0/src/robot/htmldata/rebot/common.css +362 -0
  20. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/doc_formatting.css +13 -7
  21. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/log.css +51 -10
  22. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/log.html +14 -23
  23. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/model.js +2 -4
  24. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/report.css +83 -19
  25. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/report.html +22 -7
  26. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/testdata.js +10 -3
  27. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/view.js +84 -0
  28. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/template.py +3 -3
  29. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/builder.py +0 -8
  30. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/datatypes.py +9 -10
  31. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/htmlutils.py +4 -7
  32. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/jsonbuilder.py +38 -20
  33. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/model.py +21 -28
  34. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/robotbuilder.py +50 -31
  35. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/standardtypes.py +9 -1
  36. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/xmlbuilder.py +35 -20
  37. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/xmlwriter.py +18 -38
  38. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/BuiltIn.py +255 -205
  39. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/Collections.py +384 -240
  40. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/DateTime.py +73 -60
  41. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/OperatingSystem.py +6 -5
  42. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/Process.py +26 -27
  43. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/Remote.py +40 -36
  44. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/String.py +66 -76
  45. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/XML.py +66 -59
  46. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/__init__.py +2 -2
  47. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/dialogs_py.py +14 -2
  48. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/__init__.py +5 -5
  49. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/body.py +44 -13
  50. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/configurer.py +19 -15
  51. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/control.py +230 -88
  52. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/filter.py +31 -25
  53. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/itemlist.py +9 -8
  54. robotframework-7.0/src/robot/model/keyword.py +77 -0
  55. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/message.py +19 -10
  56. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/modelobject.py +27 -15
  57. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/modifier.py +1 -1
  58. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/namepatterns.py +3 -25
  59. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/stats.py +9 -15
  60. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/tags.py +1 -1
  61. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/testcase.py +15 -27
  62. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/testsuite.py +44 -28
  63. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/visitor.py +35 -8
  64. robotframework-7.0/src/robot/output/console/dotted.py +90 -0
  65. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/output/console/quiet.py +3 -2
  66. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/output/console/verbose.py +61 -61
  67. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/output/debugfile.py +39 -24
  68. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/output/filelogger.py +18 -15
  69. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/output/librarylogger.py +3 -2
  70. robotframework-7.0/src/robot/output/listeners.py +753 -0
  71. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/output/logger.py +216 -80
  72. robotframework-7.0/src/robot/output/loggerapi.py +215 -0
  73. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/output/loggerhelper.py +23 -56
  74. robotframework-7.0/src/robot/output/output.py +185 -0
  75. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/output/stdoutlogsplitter.py +8 -5
  76. robotframework-7.0/src/robot/output/xmllogger.py +459 -0
  77. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/lexer/blocklexers.py +17 -13
  78. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/lexer/context.py +12 -2
  79. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/lexer/lexer.py +1 -1
  80. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/lexer/settings.py +6 -3
  81. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/lexer/statementlexers.py +39 -10
  82. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/lexer/tokens.py +27 -29
  83. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/model/blocks.py +19 -6
  84. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/model/statements.py +193 -94
  85. robotframework-7.0/src/robot/parsing/model/visitor.py +100 -0
  86. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/rebot.py +2 -0
  87. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/reporting/expandkeywordmatcher.py +1 -1
  88. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/reporting/jsbuildingcontext.py +8 -6
  89. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/reporting/jsmodelbuilders.py +88 -61
  90. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/reporting/logreportwriters.py +16 -10
  91. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/reporting/outputwriter.py +18 -2
  92. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/reporting/resultwriter.py +4 -4
  93. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/reporting/stringcache.py +3 -3
  94. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/reporting/xunitwriter.py +15 -21
  95. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/result/__init__.py +3 -2
  96. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/result/configurer.py +12 -9
  97. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/result/executionresult.py +56 -8
  98. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/result/flattenkeywordmatcher.py +48 -9
  99. robotframework-7.0/src/robot/result/keywordremover.py +207 -0
  100. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/result/merger.py +1 -1
  101. robotframework-7.0/src/robot/result/model.py +1185 -0
  102. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/result/modeldeprecation.py +9 -3
  103. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/result/resultbuilder.py +46 -36
  104. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/result/xmlelementhandlers.py +83 -43
  105. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/run.py +3 -1
  106. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/__init__.py +14 -4
  107. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/arguments/__init__.py +2 -1
  108. robotframework-7.0/src/robot/running/arguments/argumentconverter.py +100 -0
  109. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/arguments/argumentmapper.py +26 -24
  110. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/arguments/argumentparser.py +85 -61
  111. robotframework-7.0/src/robot/running/arguments/argumentresolver.py +158 -0
  112. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/arguments/argumentspec.py +83 -116
  113. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/arguments/argumentvalidator.py +33 -27
  114. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/arguments/customconverters.py +15 -12
  115. robotframework-7.0/src/robot/running/arguments/embedded.py +145 -0
  116. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/arguments/typeconverters.py +268 -220
  117. robotframework-7.0/src/robot/running/arguments/typeinfo.py +317 -0
  118. robotframework-7.0/src/robot/running/arguments/typeinfoparser.py +219 -0
  119. robotframework-7.0/src/robot/running/arguments/typevalidator.py +60 -0
  120. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/bodyrunner.py +147 -129
  121. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/builder/builders.py +17 -26
  122. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/builder/parsers.py +17 -11
  123. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/builder/settings.py +9 -17
  124. robotframework-7.0/src/robot/running/builder/transformers.py +535 -0
  125. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/context.py +113 -31
  126. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/dynamicmethods.py +62 -34
  127. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/importer.py +27 -49
  128. robotframework-7.0/src/robot/running/invalidkeyword.py +67 -0
  129. robotframework-7.0/src/robot/running/keywordfinder.py +91 -0
  130. robotframework-7.0/src/robot/running/keywordimplementation.py +164 -0
  131. robotframework-7.0/src/robot/running/librarykeyword.py +392 -0
  132. robotframework-7.0/src/robot/running/librarykeywordrunner.py +250 -0
  133. robotframework-7.0/src/robot/running/libraryscopes.py +115 -0
  134. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/model.py +198 -337
  135. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/namespace.py +124 -137
  136. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/outputcapture.py +20 -12
  137. robotframework-7.0/src/robot/running/resourcemodel.py +448 -0
  138. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/statusreporter.py +16 -13
  139. robotframework-7.0/src/robot/running/suiterunner.py +265 -0
  140. robotframework-7.0/src/robot/running/testlibraries.py +500 -0
  141. robotframework-7.0/src/robot/running/userkeywordrunner.py +260 -0
  142. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/testdoc.py +18 -13
  143. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/__init__.py +53 -35
  144. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/connectioncache.py +64 -59
  145. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/dotdict.py +3 -0
  146. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/encodingsniffer.py +9 -4
  147. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/escaping.py +19 -19
  148. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/importer.py +2 -2
  149. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/markupwriters.py +23 -15
  150. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/misc.py +1 -2
  151. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/normalizing.py +9 -24
  152. robotframework-7.0/src/robot/utils/notset.py +33 -0
  153. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/platform.py +15 -5
  154. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/robotio.py +9 -9
  155. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/robotpath.py +1 -0
  156. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/robottime.py +122 -90
  157. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/robottypes.py +21 -31
  158. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/setter.py +0 -5
  159. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/text.py +7 -4
  160. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/unic.py +2 -2
  161. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/variables/__init__.py +2 -2
  162. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/variables/assigner.py +17 -19
  163. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/variables/evaluation.py +20 -17
  164. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/variables/filesetter.py +80 -80
  165. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/variables/replacer.py +33 -36
  166. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/variables/scopes.py +17 -12
  167. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/variables/search.py +66 -41
  168. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/variables/store.py +14 -16
  169. robotframework-7.0/src/robot/variables/tablesetter.py +164 -0
  170. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/variables/variables.py +1 -1
  171. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/version.py +1 -1
  172. {robotframework-6.1rc1 → robotframework-7.0}/src/robotframework.egg-info/PKG-INFO +6 -8
  173. {robotframework-6.1rc1 → robotframework-7.0}/src/robotframework.egg-info/SOURCES.txt +10 -8
  174. {robotframework-6.1rc1 → robotframework-7.0}/tasks.py +6 -6
  175. robotframework-6.1rc1/src/robot/htmldata/rebot/common.css +0 -239
  176. robotframework-6.1rc1/src/robot/libraries/Reserved.py +0 -48
  177. robotframework-6.1rc1/src/robot/model/keyword.py +0 -173
  178. robotframework-6.1rc1/src/robot/output/console/dotted.py +0 -90
  179. robotframework-6.1rc1/src/robot/output/listenerarguments.py +0 -165
  180. robotframework-6.1rc1/src/robot/output/listenermethods.py +0 -113
  181. robotframework-6.1rc1/src/robot/output/listeners.py +0 -174
  182. robotframework-6.1rc1/src/robot/output/output.py +0 -95
  183. robotframework-6.1rc1/src/robot/output/xmllogger.py +0 -354
  184. robotframework-6.1rc1/src/robot/parsing/model/visitor.py +0 -67
  185. robotframework-6.1rc1/src/robot/result/keywordremover.py +0 -183
  186. robotframework-6.1rc1/src/robot/result/model.py +0 -957
  187. robotframework-6.1rc1/src/robot/running/arguments/argumentconverter.py +0 -79
  188. robotframework-6.1rc1/src/robot/running/arguments/argumentresolver.py +0 -131
  189. robotframework-6.1rc1/src/robot/running/arguments/embedded.py +0 -146
  190. robotframework-6.1rc1/src/robot/running/arguments/typevalidator.py +0 -56
  191. robotframework-6.1rc1/src/robot/running/builder/transformers.py +0 -642
  192. robotframework-6.1rc1/src/robot/running/handlers.py +0 -321
  193. robotframework-6.1rc1/src/robot/running/handlerstore.py +0 -66
  194. robotframework-6.1rc1/src/robot/running/librarykeywordrunner.py +0 -238
  195. robotframework-6.1rc1/src/robot/running/libraryscopes.py +0 -97
  196. robotframework-6.1rc1/src/robot/running/modelcombiner.py +0 -32
  197. robotframework-6.1rc1/src/robot/running/suiterunner.py +0 -249
  198. robotframework-6.1rc1/src/robot/running/testlibraries.py +0 -420
  199. robotframework-6.1rc1/src/robot/running/usererrorhandler.py +0 -75
  200. robotframework-6.1rc1/src/robot/running/userkeyword.py +0 -111
  201. robotframework-6.1rc1/src/robot/running/userkeywordrunner.py +0 -274
  202. robotframework-6.1rc1/src/robot/variables/tablesetter.py +0 -156
  203. {robotframework-6.1rc1 → robotframework-7.0}/AUTHORS.rst +0 -0
  204. {robotframework-6.1rc1 → robotframework-7.0}/BUILD.rst +0 -0
  205. {robotframework-6.1rc1 → robotframework-7.0}/CONTRIBUTING.rst +0 -0
  206. {robotframework-6.1rc1 → robotframework-7.0}/COPYRIGHT.txt +0 -0
  207. {robotframework-6.1rc1 → robotframework-7.0}/LICENSE.txt +0 -0
  208. {robotframework-6.1rc1 → robotframework-7.0}/MANIFEST.in +0 -0
  209. {robotframework-6.1rc1 → robotframework-7.0}/setup.cfg +0 -0
  210. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/__init__.py +0 -0
  211. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/__main__.py +0 -0
  212. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/conf/__init__.py +0 -0
  213. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/errors.py +0 -0
  214. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/__init__.py +0 -0
  215. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/common/__init__.py +0 -0
  216. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/common/js_disabled.css +0 -0
  217. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/jsonwriter.py +0 -0
  218. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/lib/__init__.py +0 -0
  219. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/lib/jquery.highlight.min.js +0 -0
  220. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/lib/jquery.min.js +0 -0
  221. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/lib/jquery.tablesorter.min.js +0 -0
  222. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/lib/jquery.tmpl.min.js +0 -0
  223. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/lib/jsxcompressor.min.js +0 -0
  224. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/libdoc/__init__.py +0 -0
  225. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/libdoc/doc_formatting.css +0 -0
  226. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/libdoc/print.css +0 -0
  227. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/libdoc/pygments.css +0 -0
  228. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/__init__.py +0 -0
  229. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/fileloading.js +0 -0
  230. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/log.js +0 -0
  231. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/print.css +0 -0
  232. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/util.js +0 -0
  233. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/testdoc/__init__.py +0 -0
  234. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/testdoc/testdoc.css +0 -0
  235. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/testdoc/testdoc.html +0 -0
  236. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdoc.py +0 -0
  237. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/__init__.py +0 -0
  238. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/consoleviewer.py +0 -0
  239. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/htmlwriter.py +0 -0
  240. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/jsonwriter.py +0 -0
  241. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/output.py +0 -0
  242. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/writer.py +0 -0
  243. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/Dialogs.py +0 -0
  244. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/Easter.py +0 -0
  245. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/Screenshot.py +0 -0
  246. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/Telnet.py +0 -0
  247. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/fixture.py +0 -0
  248. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/metadata.py +0 -0
  249. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/statistics.py +0 -0
  250. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/suitestatistics.py +0 -0
  251. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/tagsetter.py +0 -0
  252. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/tagstatistics.py +0 -0
  253. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/totalstatistics.py +0 -0
  254. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/output/__init__.py +0 -0
  255. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/output/console/__init__.py +0 -0
  256. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/output/console/highlighting.py +0 -0
  257. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/output/pyloggingconf.py +0 -0
  258. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/__init__.py +0 -0
  259. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/lexer/__init__.py +0 -0
  260. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/lexer/tokenizer.py +0 -0
  261. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/model/__init__.py +0 -0
  262. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/parser/__init__.py +0 -0
  263. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/parser/blockparsers.py +0 -0
  264. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/parser/fileparser.py +0 -0
  265. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/parser/parser.py +0 -0
  266. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/suitestructure.py +0 -0
  267. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/pythonpathsetter.py +0 -0
  268. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/reporting/__init__.py +0 -0
  269. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/reporting/jsexecutionresult.py +0 -0
  270. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/reporting/jswriter.py +0 -0
  271. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/result/executionerrors.py +0 -0
  272. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/result/messagefilter.py +0 -0
  273. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/result/suiteteardownfailed.py +0 -0
  274. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/result/visitor.py +0 -0
  275. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/builder/__init__.py +0 -0
  276. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/randomizer.py +0 -0
  277. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/runkwregister.py +0 -0
  278. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/signalhandler.py +0 -0
  279. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/status.py +0 -0
  280. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/timeouts/__init__.py +0 -0
  281. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/timeouts/posix.py +0 -0
  282. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/timeouts/windows.py +0 -0
  283. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/application.py +0 -0
  284. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/argumentparser.py +0 -0
  285. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/asserts.py +0 -0
  286. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/charwidth.py +0 -0
  287. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/compress.py +0 -0
  288. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/encoding.py +0 -0
  289. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/error.py +0 -0
  290. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/etreewrapper.py +0 -0
  291. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/filereader.py +0 -0
  292. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/frange.py +0 -0
  293. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/htmlformatters.py +0 -0
  294. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/markuputils.py +0 -0
  295. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/match.py +0 -0
  296. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/recommendations.py +0 -0
  297. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/restreader.py +0 -0
  298. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/robotenv.py +0 -0
  299. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/robotinspect.py +0 -0
  300. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/sortable.py +0 -0
  301. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/typehints.py +0 -0
  302. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/variables/finders.py +0 -0
  303. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/variables/notfound.py +0 -0
  304. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/variables/resolvable.py +0 -0
  305. {robotframework-6.1rc1 → robotframework-7.0}/src/robotframework.egg-info/dependency_links.txt +0 -0
  306. {robotframework-6.1rc1 → robotframework-7.0}/src/robotframework.egg-info/entry_points.txt +0 -0
  307. {robotframework-6.1rc1 → robotframework-7.0}/src/robotframework.egg-info/top_level.txt +0 -0
@@ -34,22 +34,17 @@ __ http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#
34
34
  __ http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#listener-interface
35
35
  """
36
36
 
37
- import sys
38
37
  import warnings
39
38
  from pathlib import Path
40
- from typing import Any, Mapping, Sequence, TYPE_CHECKING, Union
41
- if sys.version_info >= (3, 8):
42
- from typing import Literal
39
+ from typing import Literal, Mapping, Sequence, TYPE_CHECKING, TypeVar, Union
43
40
 
44
41
  from robot import model
45
42
  from robot.conf import RobotSettings
46
- from robot.errors import BreakLoop, ContinueLoop, DataError, ReturnFromKeyword
47
- from robot.model import (BodyItem, create_fixture, DataDict, Keywords, ModelObject,
48
- TestCases, TestSuites)
43
+ from robot.errors import BreakLoop, ContinueLoop, DataError, ReturnFromKeyword, VariableError
44
+ from robot.model import BodyItem, DataDict, TestSuites
49
45
  from robot.output import LOGGER, Output, pyloggingconf
50
- from robot.result import (Break as BreakResult, Continue as ContinueResult,
51
- Error as ErrorResult, Return as ReturnResult)
52
46
  from robot.utils import setter
47
+ from robot.variables import VariableResolver
53
48
 
54
49
  from .bodyrunner import ForRunner, IfRunner, KeywordRunner, TryRunner, WhileRunner
55
50
  from .randomizer import Randomizer
@@ -58,15 +53,22 @@ from .statusreporter import StatusReporter
58
53
  if TYPE_CHECKING:
59
54
  from robot.parsing import File
60
55
  from .builder import TestDefaults
56
+ from .resourcemodel import ResourceFile, UserKeyword
61
57
 
62
58
 
59
+ IT = TypeVar('IT', bound='IfBranch|TryBranch')
63
60
  BodyItemParent = Union['TestSuite', 'TestCase', 'UserKeyword', 'For', 'If', 'IfBranch',
64
61
  'Try', 'TryBranch', 'While', None]
65
62
 
66
63
 
67
- class Body(model.BaseBody['Keyword', 'For', 'While', 'If', 'Try', 'Return', 'Continue',
68
- 'Break', 'model.Message', 'Error']):
69
- __slots__ = []
64
+ class Body(model.BaseBody['Keyword', 'For', 'While', 'If', 'Try', 'Var', 'Return',
65
+ 'Continue', 'Break', 'model.Message', 'Error']):
66
+ __slots__ = ()
67
+
68
+
69
+ class Branches(model.BaseBranches['Keyword', 'For', 'While', 'If', 'Try', 'Var', 'Return',
70
+ 'Continue', 'Break', 'model.Message', 'Error', IT]):
71
+ __slots__ = ()
70
72
 
71
73
 
72
74
  class WithSource:
@@ -90,11 +92,32 @@ class Keyword(model.Keyword, WithSource):
90
92
 
91
93
  The actual keyword that is executed depends on the context where this model
92
94
  is executed.
95
+
96
+ Arguments originating from normal Robot Framework data are stored as list of
97
+ strings in the exact same format as in the data. This means that arguments can
98
+ have variables and escape characters, and that named arguments are specified
99
+ using the ``name=value`` syntax.
100
+
101
+ If arguments are set programmatically, it is possible to use also other types
102
+ than strings. To support non-string values with named arguments, it is possible
103
+ to use two-item tuples like ``('name', 'value')``. To avoid ambiguity if an
104
+ argument contains a literal ``=`` character, positional arguments can also be
105
+ given using one-item tuples like ``('value',)``. In all these cases strings
106
+ can contain variables, and they must follow the escaping rules used in normal
107
+ data.
108
+
109
+ Arguments can also be given directly as a tuple containing list of positional
110
+ arguments and a dictionary of named arguments. In this case arguments are
111
+ used as-is without replacing variables or handling escapes. Argument conversion
112
+ and validation is done even in this case, though.
113
+
114
+ Support for specifying arguments using tuples and giving them directly as
115
+ positional and named arguments are new in Robot Framework 7.0.
93
116
  """
94
117
  __slots__ = ['lineno']
95
118
 
96
119
  def __init__(self, name: str = '',
97
- args: Sequence[str] = (),
120
+ args: model.Arguments = (),
98
121
  assign: Sequence[str] = (),
99
122
  type: str = BodyItem.KEYWORD,
100
123
  parent: BodyItemParent = None,
@@ -102,14 +125,36 @@ class Keyword(model.Keyword, WithSource):
102
125
  super().__init__(name, args, assign, type, parent)
103
126
  self.lineno = lineno
104
127
 
128
+ @classmethod
129
+ def from_json(cls, source) -> 'Keyword':
130
+ kw = super().from_json(source)
131
+ # Argument tuples have a special meaning during execution.
132
+ # Tuples are represented as lists in JSON, so we need to convert them.
133
+ kw.args = tuple([tuple(a) if isinstance(a, list) else a
134
+ for a in kw.args])
135
+ return kw
136
+
105
137
  def to_dict(self) -> DataDict:
106
138
  data = super().to_dict()
107
139
  if self.lineno:
108
140
  data['lineno'] = self.lineno
109
141
  return data
110
142
 
111
- def run(self, context, run=True, templated=None):
112
- return KeywordRunner(context, run).run(self)
143
+ def run(self, result, context, run=True, templated=None):
144
+ return KeywordRunner(context, run).run(self, result.body.create_keyword())
145
+
146
+
147
+ class ForIteration(model.ForIteration, WithSource):
148
+ __slots__ = ('lineno', 'error')
149
+ body_class = Body
150
+
151
+ def __init__(self, assign: 'Mapping[str, str]|None' = None,
152
+ parent: BodyItemParent = None,
153
+ lineno: 'int|None' = None,
154
+ error: 'str|None' = None):
155
+ super().__init__(assign, parent)
156
+ self.lineno = lineno
157
+ self.error = error
113
158
 
114
159
 
115
160
  @Body.register
@@ -117,8 +162,8 @@ class For(model.For, WithSource):
117
162
  __slots__ = ['lineno', 'error']
118
163
  body_class = Body
119
164
 
120
- def __init__(self, variables: Sequence[str] = (),
121
- flavor: "Literal['IN', 'IN RANGE', 'IN ENUMERATE', 'IN ZIP']" = 'IN',
165
+ def __init__(self, assign: Sequence[str] = (),
166
+ flavor: Literal['IN', 'IN RANGE', 'IN ENUMERATE', 'IN ZIP'] = 'IN',
122
167
  values: Sequence[str] = (),
123
168
  start: 'str|None' = None,
124
169
  mode: 'str|None' = None,
@@ -126,10 +171,17 @@ class For(model.For, WithSource):
126
171
  parent: BodyItemParent = None,
127
172
  lineno: 'int|None' = None,
128
173
  error: 'str|None' = None):
129
- super().__init__(variables, flavor, values, start, mode, fill, parent)
174
+ super().__init__(assign, flavor, values, start, mode, fill, parent)
130
175
  self.lineno = lineno
131
176
  self.error = error
132
177
 
178
+ @classmethod
179
+ def from_dict(cls, data: DataDict) -> 'For':
180
+ # RF 6.1 compatibility
181
+ if 'variables' in data:
182
+ data['assign'] = data.pop('variables')
183
+ return super().from_dict(data)
184
+
133
185
  def to_dict(self) -> DataDict:
134
186
  data = super().to_dict()
135
187
  if self.lineno:
@@ -138,8 +190,27 @@ class For(model.For, WithSource):
138
190
  data['error'] = self.error
139
191
  return data
140
192
 
141
- def run(self, context, run=True, templated=False):
142
- return ForRunner(context, self.flavor, run, templated).run(self)
193
+ def run(self, result, context, run=True, templated=False):
194
+ result = result.body.create_for(self.assign, self.flavor, self.values,
195
+ self.start, self.mode, self.fill)
196
+ return ForRunner(context, self.flavor, run, templated).run(self, result)
197
+
198
+ def get_iteration(self, assign: 'Mapping[str, str]|None' = None) -> ForIteration:
199
+ iteration = ForIteration(assign, self, self.lineno, self.error)
200
+ iteration.body = [item.to_dict() for item in self.body]
201
+ return iteration
202
+
203
+
204
+ class WhileIteration(model.WhileIteration, WithSource):
205
+ __slots__ = ('lineno', 'error')
206
+ body_class = Body
207
+
208
+ def __init__(self, parent: BodyItemParent = None,
209
+ lineno: 'int|None' = None,
210
+ error: 'str|None' = None):
211
+ super().__init__(parent)
212
+ self.lineno = lineno
213
+ self.error = error
143
214
 
144
215
 
145
216
  @Body.register
@@ -166,13 +237,20 @@ class While(model.While, WithSource):
166
237
  data['error'] = self.error
167
238
  return data
168
239
 
169
- def run(self, context, run=True, templated=False):
170
- return WhileRunner(context, run, templated).run(self)
240
+ def run(self, result, context, run=True, templated=False):
241
+ result = result.body.create_while(self.condition, self.limit, self.on_limit,
242
+ self.on_limit_message)
243
+ return WhileRunner(context, run, templated).run(self, result)
244
+
245
+ def get_iteration(self) -> WhileIteration:
246
+ iteration = WhileIteration(self, self.lineno, self.error)
247
+ iteration.body = [item.to_dict() for item in self.body]
248
+ return iteration
171
249
 
172
250
 
173
251
  class IfBranch(model.IfBranch, WithSource):
174
- __slots__ = ['lineno']
175
252
  body_class = Body
253
+ __slots__ = ['lineno']
176
254
 
177
255
  def __init__(self, type: str = BodyItem.IF,
178
256
  condition: 'str|None' = None,
@@ -190,8 +268,9 @@ class IfBranch(model.IfBranch, WithSource):
190
268
 
191
269
  @Body.register
192
270
  class If(model.If, WithSource):
193
- __slots__ = ['lineno', 'error']
194
271
  branch_class = IfBranch
272
+ branches_class = Branches[branch_class]
273
+ __slots__ = ['lineno', 'error']
195
274
 
196
275
  def __init__(self, parent: BodyItemParent = None,
197
276
  lineno: 'int|None' = None,
@@ -200,8 +279,8 @@ class If(model.If, WithSource):
200
279
  self.lineno = lineno
201
280
  self.error = error
202
281
 
203
- def run(self, context, run=True, templated=False):
204
- return IfRunner(context, run, templated).run(self)
282
+ def run(self, result, context, run=True, templated=False):
283
+ return IfRunner(context, run, templated).run(self, result.body.create_if())
205
284
 
206
285
  def to_dict(self) -> DataDict:
207
286
  data = super().to_dict()
@@ -213,18 +292,25 @@ class If(model.If, WithSource):
213
292
 
214
293
 
215
294
  class TryBranch(model.TryBranch, WithSource):
216
- __slots__ = ['lineno']
217
295
  body_class = Body
296
+ __slots__ = ['lineno']
218
297
 
219
298
  def __init__(self, type: str = BodyItem.TRY,
220
299
  patterns: Sequence[str] = (),
221
300
  pattern_type: 'str|None' = None,
222
- variable: 'str|None' = None,
301
+ assign: 'str|None' = None,
223
302
  parent: BodyItemParent = None,
224
303
  lineno: 'int|None' = None):
225
- super().__init__(type, patterns, pattern_type, variable, parent)
304
+ super().__init__(type, patterns, pattern_type, assign, parent)
226
305
  self.lineno = lineno
227
306
 
307
+ @classmethod
308
+ def from_dict(cls, data: DataDict) -> 'TryBranch':
309
+ # RF 6.1 compatibility.
310
+ if 'variable' in data:
311
+ data['assign'] = data.pop('variable')
312
+ return super().from_dict(data)
313
+
228
314
  def to_dict(self) -> DataDict:
229
315
  data = super().to_dict()
230
316
  if self.lineno:
@@ -234,8 +320,9 @@ class TryBranch(model.TryBranch, WithSource):
234
320
 
235
321
  @Body.register
236
322
  class Try(model.Try, WithSource):
237
- __slots__ = ['lineno', 'error']
238
323
  branch_class = TryBranch
324
+ branches_class = Branches[branch_class]
325
+ __slots__ = ['lineno', 'error']
239
326
 
240
327
  def __init__(self, parent: BodyItemParent = None,
241
328
  lineno: 'int|None' = None,
@@ -244,8 +331,65 @@ class Try(model.Try, WithSource):
244
331
  self.lineno = lineno
245
332
  self.error = error
246
333
 
247
- def run(self, context, run=True, templated=False):
248
- return TryRunner(context, run, templated).run(self)
334
+ def run(self, result, context, run=True, templated=False):
335
+ return TryRunner(context, run, templated).run(self, result.body.create_try())
336
+
337
+ def to_dict(self) -> DataDict:
338
+ data = super().to_dict()
339
+ if self.lineno:
340
+ data['lineno'] = self.lineno
341
+ if self.error:
342
+ data['error'] = self.error
343
+ return data
344
+
345
+
346
+ @Body.register
347
+ class Var(model.Var, WithSource):
348
+ __slots__ = ['lineno', 'error']
349
+
350
+ def __init__(self, name: str = '',
351
+ value: 'str|Sequence[str]' = (),
352
+ scope: 'str|None' = None,
353
+ separator: 'str|None' = None,
354
+ parent: BodyItemParent = None,
355
+ lineno: 'int|None' = None,
356
+ error: 'str|None' = None):
357
+ super().__init__(name, value, scope, separator, parent)
358
+ self.lineno = lineno
359
+ self.error = error
360
+
361
+ def run(self, result, context, run=True, templated=False):
362
+ result = result.body.create_var(self.name, self.value, self.scope, self.separator)
363
+ with StatusReporter(self, result, context, run):
364
+ if run:
365
+ if self.error:
366
+ raise DataError(self.error, syntax=True)
367
+ if not context.dry_run:
368
+ scope = self._get_scope(context.variables)
369
+ setter = getattr(context.variables, f'set_{scope}')
370
+ try:
371
+ resolver = VariableResolver.from_variable(self)
372
+ setter(self._resolve_name(self.name, context.variables),
373
+ resolver.resolve(context.variables))
374
+ except DataError as err:
375
+ raise VariableError(f"Setting variable '{self.name}' failed: {err}")
376
+
377
+ def _get_scope(self, variables):
378
+ if not self.scope:
379
+ return 'local'
380
+ try:
381
+ scope = variables.replace_string(self.scope)
382
+ if scope.upper() == 'TASK':
383
+ return 'test'
384
+ if scope.upper() in ('GLOBAL', 'SUITE', 'TEST', 'LOCAL'):
385
+ return scope.lower()
386
+ raise DataError(f"Value '{scope}' is not accepted. Valid values are "
387
+ f"'GLOBAL', 'SUITE', 'TEST', 'TASK' and 'LOCAL'.")
388
+ except DataError as err:
389
+ raise DataError(f"Invalid VAR scope: {err}")
390
+
391
+ def _resolve_name(self, name, variables):
392
+ return name[:2] + variables.replace_string(name[2:-1]) + '}'
249
393
 
250
394
  def to_dict(self) -> DataDict:
251
395
  data = super().to_dict()
@@ -268,8 +412,9 @@ class Return(model.Return, WithSource):
268
412
  self.lineno = lineno
269
413
  self.error = error
270
414
 
271
- def run(self, context, run=True, templated=False):
272
- with StatusReporter(self, ReturnResult(self.values), context, run):
415
+ def run(self, result, context, run=True, templated=False):
416
+ result = result.body.create_return(self.values)
417
+ with StatusReporter(self, result, context, run):
273
418
  if run:
274
419
  if self.error:
275
420
  raise DataError(self.error, syntax=True)
@@ -296,8 +441,9 @@ class Continue(model.Continue, WithSource):
296
441
  self.lineno = lineno
297
442
  self.error = error
298
443
 
299
- def run(self, context, run=True, templated=False):
300
- with StatusReporter(self, ContinueResult(), context, run):
444
+ def run(self, result, context, run=True, templated=False):
445
+ result = result.body.create_continue()
446
+ with StatusReporter(self, result, context, run):
301
447
  if run:
302
448
  if self.error:
303
449
  raise DataError(self.error, syntax=True)
@@ -324,8 +470,9 @@ class Break(model.Break, WithSource):
324
470
  self.lineno = lineno
325
471
  self.error = error
326
472
 
327
- def run(self, context, run=True, templated=False):
328
- with StatusReporter(self, BreakResult(), context, run):
473
+ def run(self, result, context, run=True, templated=False):
474
+ result = result.body.create_break()
475
+ with StatusReporter(self, result, context, run):
329
476
  if run:
330
477
  if self.error:
331
478
  raise DataError(self.error, syntax=True)
@@ -353,8 +500,9 @@ class Error(model.Error, WithSource):
353
500
  self.lineno = lineno
354
501
  self.error = error
355
502
 
356
- def run(self, context, run=True, templated=False):
357
- with StatusReporter(self, ErrorResult(self.values), context, run):
503
+ def run(self, result, context, run=True, templated=False):
504
+ result = result.body.create_error(self.values)
505
+ with StatusReporter(self, result, context, run):
358
506
  if run:
359
507
  raise DataError(self.error)
360
508
 
@@ -362,8 +510,7 @@ class Error(model.Error, WithSource):
362
510
  data = super().to_dict()
363
511
  if self.lineno:
364
512
  data['lineno'] = self.lineno
365
- if self.error:
366
- data['error'] = self.error
513
+ data['error'] = self.error
367
514
  return data
368
515
 
369
516
 
@@ -417,19 +564,23 @@ class TestSuite(model.TestSuite[Keyword, TestCase]):
417
564
  doc: str = '',
418
565
  metadata: 'Mapping[str, str]|None' = None,
419
566
  source: 'Path|str|None' = None,
420
- rpa: 'bool|None' = None,
567
+ rpa: 'bool|None' = False,
421
568
  parent: 'TestSuite|None' = None):
422
569
  super().__init__(name, doc, metadata, source, rpa, parent)
423
570
  #: :class:`ResourceFile` instance containing imports, variables and
424
571
  #: keywords the suite owns. When data is parsed from the file system,
425
572
  #: this data comes from the same test case file that creates the suite.
426
- self.resource = ResourceFile(parent=self)
573
+ self.resource = None
427
574
 
428
575
  @setter
429
- def resource(self, resource: 'ResourceFile|dict') -> 'ResourceFile':
576
+ def resource(self, resource: 'ResourceFile|dict|None') -> 'ResourceFile':
577
+ from .resourcemodel import ResourceFile
578
+
579
+ if resource is None:
580
+ resource = ResourceFile()
430
581
  if isinstance(resource, dict):
431
582
  resource = ResourceFile.from_dict(resource)
432
- resource.parent = self
583
+ resource.owner = self
433
584
  return resource
434
585
 
435
586
  @classmethod
@@ -556,7 +707,7 @@ class TestSuite(model.TestSuite[Keyword, TestCase]):
556
707
  If such an option is used only once, it can be given also as a single
557
708
  string like ``variable='VAR:value'``.
558
709
 
559
- Additionally listener option allows passing object directly instead of
710
+ Additionally, listener option allows passing object directly instead of
560
711
  listener name, e.g. ``run('tests.robot', listener=Listener())``.
561
712
 
562
713
  To capture stdout and/or stderr streams, pass open file objects in as
@@ -612,293 +763,3 @@ class TestSuite(model.TestSuite[Keyword, TestCase]):
612
763
  data = super().to_dict()
613
764
  data['resource'] = self.resource.to_dict()
614
765
  return data
615
-
616
-
617
- class Variable(ModelObject):
618
- repr_args = ('name', 'value')
619
-
620
- def __init__(self, name: str = '',
621
- value: Sequence[str] = (),
622
- parent: 'ResourceFile|None' = None,
623
- lineno: 'int|None' = None,
624
- error: 'str|None' = None):
625
- self.name = name
626
- self.value = tuple(value)
627
- self.parent = parent
628
- self.lineno = lineno
629
- self.error = error
630
-
631
- @property
632
- def source(self) -> 'Path|None':
633
- return self.parent.source if self.parent is not None else None
634
-
635
- def report_invalid_syntax(self, message: str, level: str = 'ERROR'):
636
- source = self.source or '<unknown>'
637
- line = f' on line {self.lineno}' if self.lineno else ''
638
- LOGGER.write(f"Error in file '{source}'{line}: "
639
- f"Setting variable '{self.name}' failed: {message}", level)
640
-
641
- def to_dict(self) -> DataDict:
642
- data = {'name': self.name, 'value': self.value}
643
- if self.lineno:
644
- data['lineno'] = self.lineno
645
- if self.error:
646
- data['error'] = self.error
647
- return data
648
-
649
-
650
- class ResourceFile(ModelObject):
651
- repr_args = ('source',)
652
- __slots__ = ('_source', 'parent', 'doc')
653
-
654
- def __init__(self, source: 'Path|str|None' = None,
655
- parent: 'TestSuite|None' = None,
656
- doc: str = ''):
657
- self.source = source
658
- self.parent = parent
659
- self.doc = doc
660
- self.imports = []
661
- self.variables = []
662
- self.keywords = []
663
-
664
- @property
665
- def source(self) -> 'Path|None':
666
- if self._source:
667
- return self._source
668
- if self.parent:
669
- return self.parent.source
670
- return None
671
-
672
- @source.setter
673
- def source(self, source: 'Path|str|None'):
674
- if isinstance(source, str):
675
- source = Path(source)
676
- self._source = source
677
-
678
- @setter
679
- def imports(self, imports: Sequence['Import']) -> 'Imports':
680
- return Imports(self, imports)
681
-
682
- @setter
683
- def variables(self, variables: Sequence['Variable']) -> 'Variables':
684
- return Variables(self, variables)
685
-
686
- @setter
687
- def keywords(self, keywords: Sequence['UserKeyword']) -> 'UserKeywords':
688
- return UserKeywords(self, keywords)
689
-
690
- def to_dict(self) -> DataDict:
691
- data = {}
692
- if self._source:
693
- data['source'] = str(self._source)
694
- if self.doc:
695
- data['doc'] = self.doc
696
- if self.imports:
697
- data['imports'] = self.imports.to_dicts()
698
- if self.variables:
699
- data['variables'] = self.variables.to_dicts()
700
- if self.keywords:
701
- data['keywords'] = self.keywords.to_dicts()
702
- return data
703
-
704
-
705
- class UserKeyword(ModelObject):
706
- repr_args = ('name', 'args')
707
- fixture_class = Keyword
708
- __slots__ = ['name', 'args', 'doc', 'return_', 'timeout', 'lineno', 'parent',
709
- 'error', '_teardown']
710
-
711
- def __init__(self, name: str = '',
712
- args: Sequence[str] = (),
713
- doc: str = '',
714
- tags: Sequence[str] = (),
715
- return_: Sequence[str] = (),
716
- timeout: 'str|None' = None,
717
- lineno: 'int|None' = None,
718
- parent: 'ResourceFile|None' = None,
719
- error: 'str|None' = None):
720
- self.name = name
721
- self.args = tuple(args)
722
- self.doc = doc
723
- self.tags = tags
724
- self.return_ = tuple(return_)
725
- self.timeout = timeout
726
- self.lineno = lineno
727
- self.parent = parent
728
- self.error = error
729
- self.body = []
730
- self._teardown = None
731
-
732
- @setter
733
- def body(self, body: 'Sequence[BodyItem|DataDict]') -> Body:
734
- return Body(self, body)
735
-
736
- @property
737
- def keywords(self) -> Keywords:
738
- """Deprecated since Robot Framework 4.0.
739
-
740
- Use :attr:`body` or :attr:`teardown` instead.
741
- """
742
- kws = list(self.body)
743
- if self.teardown:
744
- kws.append(self.teardown)
745
- return Keywords(self, kws)
746
-
747
- @keywords.setter
748
- def keywords(self, keywords):
749
- Keywords.raise_deprecation_error()
750
-
751
- @property
752
- def teardown(self) -> Keyword:
753
- if self._teardown is None:
754
- self._teardown = create_fixture(self.fixture_class, None, self, Keyword.TEARDOWN)
755
- return self._teardown
756
-
757
- @teardown.setter
758
- def teardown(self, teardown: 'Keyword|DataDict|None'):
759
- self._teardown = create_fixture(self.fixture_class, teardown, self, Keyword.TEARDOWN)
760
-
761
- @property
762
- def has_teardown(self) -> bool:
763
- """Check does a keyword have a teardown without creating a teardown object.
764
-
765
- A difference between using ``if uk.has_teardown:`` and ``if uk.teardown:``
766
- is that accessing the :attr:`teardown` attribute creates a :class:`Keyword`
767
- object representing the teardown even when the user keyword actually does
768
- not have one. This can have an effect on memory usage.
769
-
770
- New in Robot Framework 6.1.
771
- """
772
- return bool(self._teardown)
773
-
774
- @setter
775
- def tags(self, tags: Sequence[str]) -> model.Tags:
776
- return model.Tags(tags)
777
-
778
- @property
779
- def source(self) -> 'Path|None':
780
- return self.parent.source if self.parent is not None else None
781
-
782
- def to_dict(self) -> DataDict:
783
- data: DataDict = {'name': self.name}
784
- for name, value in [('args', self.args),
785
- ('doc', self.doc),
786
- ('tags', tuple(self.tags)),
787
- ('return_', self.return_),
788
- ('timeout', self.timeout),
789
- ('lineno', self.lineno),
790
- ('error', self.error)]:
791
- if value:
792
- data[name] = value
793
- data['body'] = self.body.to_dicts()
794
- if self.has_teardown:
795
- data['teardown'] = self.teardown.to_dict()
796
- return data
797
-
798
-
799
- class Import(ModelObject):
800
- repr_args = ('type', 'name', 'args', 'alias')
801
- LIBRARY = 'LIBRARY'
802
- RESOURCE = 'RESOURCE'
803
- VARIABLES = 'VARIABLES'
804
-
805
- def __init__(self, type: "Literal['LIBRARY', 'RESOURCE', 'VARIABLES']",
806
- name: str,
807
- args: Sequence[str] = (),
808
- alias: 'str|None' = None,
809
- parent: 'ResourceFile|None' = None,
810
- lineno: 'int|None' = None):
811
- if type not in (self.LIBRARY, self.RESOURCE, self.VARIABLES):
812
- raise ValueError(f"Invalid import type: Expected '{self.LIBRARY}', "
813
- f"'{self.RESOURCE}' or '{self.VARIABLES}', got '{type}'.")
814
- self.type = type
815
- self.name = name
816
- self.args = tuple(args)
817
- self.alias = alias
818
- self.parent = parent
819
- self.lineno = lineno
820
-
821
- @property
822
- def source(self) -> 'Path|None':
823
- return self.parent.source if self.parent is not None else None
824
-
825
- @property
826
- def directory(self) -> 'Path|None':
827
- source = self.source
828
- return source.parent if source and not source.is_dir() else source
829
-
830
- @property
831
- def setting_name(self) -> str:
832
- return self.type.title()
833
-
834
- def select(self, library: Any, resource: Any, variables: Any) -> Any:
835
- return {self.LIBRARY: library,
836
- self.RESOURCE: resource,
837
- self.VARIABLES: variables}[self.type]
838
-
839
- def report_invalid_syntax(self, message: str, level: str = 'ERROR'):
840
- source = self.source or '<unknown>'
841
- line = f' on line {self.lineno}' if self.lineno else ''
842
- LOGGER.write(f"Error in file '{source}'{line}: {message}", level)
843
-
844
- @classmethod
845
- def from_dict(cls, data) -> 'Import':
846
- return cls(**data)
847
-
848
- def to_dict(self) -> DataDict:
849
- data: DataDict = {'type': self.type, 'name': self.name}
850
- if self.args:
851
- data['args'] = self.args
852
- if self.alias:
853
- data['alias'] = self.alias
854
- if self.lineno:
855
- data['lineno'] = self.lineno
856
- return data
857
-
858
- def _include_in_repr(self, name: str, value: Any) -> bool:
859
- return name in ('type', 'name') or value
860
-
861
-
862
- class Imports(model.ItemList):
863
-
864
- def __init__(self, parent: ResourceFile, imports: Sequence[Import] = ()):
865
- super().__init__(Import, {'parent': parent}, items=imports)
866
-
867
- def library(self, name: str, args: Sequence[str] = (), alias: 'str|None' = None,
868
- lineno: 'int|None' = None) -> Import:
869
- """Create library import."""
870
- return self.create(Import.LIBRARY, name, args, alias, lineno=lineno)
871
-
872
- def resource(self, name: str, lineno: 'int|None' = None) -> Import:
873
- """Create resource import."""
874
- return self.create(Import.RESOURCE, name, lineno=lineno)
875
-
876
- def variables(self, name: str, args: Sequence[str] = (),
877
- lineno: 'int|None' = None) -> Import:
878
- """Create variables import."""
879
- return self.create(Import.VARIABLES, name, args, lineno=lineno)
880
-
881
- def create(self, *args, **kwargs) -> Import:
882
- """Generic method for creating imports.
883
-
884
- Import type specific methods :meth:`library`, :meth:`resource` and
885
- :meth:`variables` are recommended over this method.
886
- """
887
- # RF 6.1 changed types to upper case. Code below adds backwards compatibility.
888
- if args:
889
- args = (args[0].upper(),) + args[1:]
890
- elif 'type' in kwargs:
891
- kwargs['type'] = kwargs['type'].upper()
892
- return super().create(*args, **kwargs)
893
-
894
-
895
- class Variables(model.ItemList[Variable]):
896
-
897
- def __init__(self, parent: ResourceFile, variables: Sequence[Variable] = ()):
898
- super().__init__(Variable, {'parent': parent}, items=variables)
899
-
900
-
901
- class UserKeywords(model.ItemList[UserKeyword]):
902
-
903
- def __init__(self, parent: ResourceFile, keywords: Sequence[UserKeyword] = ()):
904
- super().__init__(UserKeyword, {'parent': parent}, items=keywords)