robotframework 6.1.1__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.
- {robotframework-6.1.1 → robotframework-7.0}/INSTALL.rst +25 -25
- {robotframework-6.1.1 → robotframework-7.0}/PKG-INFO +6 -8
- {robotframework-6.1.1 → robotframework-7.0}/README.rst +3 -2
- {robotframework-6.1.1 → robotframework-7.0}/setup.py +3 -6
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/api/__init__.py +4 -1
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/api/deco.py +60 -14
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/api/exceptions.py +6 -6
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/api/interfaces.py +402 -67
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/api/logger.py +27 -20
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/api/parsing.py +4 -2
- robotframework-7.0/src/robot/api/py.typed +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/conf/gatherfailed.py +2 -2
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/conf/languages.py +0 -9
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/conf/settings.py +21 -14
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/common/storage.js +11 -6
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/htmlfilewriter.py +1 -1
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/libdoc/libdoc.css +10 -2
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/libdoc/libdoc.html +10 -0
- robotframework-7.0/src/robot/htmldata/rebot/common.css +362 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/doc_formatting.css +13 -7
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/log.css +51 -10
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/log.html +14 -23
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/model.js +2 -4
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/report.css +83 -19
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/report.html +22 -7
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/testdata.js +10 -3
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/view.js +84 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/template.py +3 -3
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/builder.py +0 -8
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/datatypes.py +9 -10
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/htmlutils.py +4 -7
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/jsonbuilder.py +38 -20
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/model.py +21 -28
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/robotbuilder.py +50 -31
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/standardtypes.py +9 -1
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/xmlbuilder.py +35 -20
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/xmlwriter.py +18 -38
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/BuiltIn.py +255 -205
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/Collections.py +384 -240
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/DateTime.py +73 -60
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/OperatingSystem.py +6 -5
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/Process.py +26 -27
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/Remote.py +40 -36
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/String.py +66 -76
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/XML.py +66 -59
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/__init__.py +2 -2
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/__init__.py +5 -5
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/body.py +44 -13
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/configurer.py +15 -11
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/control.py +226 -84
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/filter.py +31 -25
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/itemlist.py +9 -8
- robotframework-7.0/src/robot/model/keyword.py +77 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/message.py +19 -10
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/modelobject.py +25 -7
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/namepatterns.py +3 -25
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/stats.py +9 -15
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/tags.py +1 -1
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/testcase.py +15 -27
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/testsuite.py +17 -26
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/visitor.py +35 -8
- robotframework-7.0/src/robot/output/console/dotted.py +90 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/console/quiet.py +3 -2
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/console/verbose.py +61 -61
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/debugfile.py +39 -24
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/filelogger.py +18 -15
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/librarylogger.py +3 -2
- robotframework-7.0/src/robot/output/listeners.py +753 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/logger.py +216 -80
- robotframework-7.0/src/robot/output/loggerapi.py +215 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/loggerhelper.py +23 -56
- robotframework-7.0/src/robot/output/output.py +185 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/stdoutlogsplitter.py +8 -5
- robotframework-7.0/src/robot/output/xmllogger.py +459 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/lexer/blocklexers.py +17 -13
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/lexer/context.py +12 -2
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/lexer/lexer.py +1 -1
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/lexer/settings.py +6 -3
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/lexer/statementlexers.py +39 -10
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/lexer/tokens.py +27 -29
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/model/blocks.py +19 -6
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/model/statements.py +193 -94
- robotframework-7.0/src/robot/parsing/model/visitor.py +100 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/rebot.py +2 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/expandkeywordmatcher.py +1 -1
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/jsbuildingcontext.py +8 -6
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/jsmodelbuilders.py +88 -61
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/logreportwriters.py +16 -10
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/outputwriter.py +18 -2
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/resultwriter.py +4 -4
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/stringcache.py +3 -3
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/xunitwriter.py +15 -21
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/__init__.py +3 -2
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/configurer.py +12 -9
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/executionresult.py +56 -8
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/flattenkeywordmatcher.py +48 -9
- robotframework-7.0/src/robot/result/keywordremover.py +207 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/merger.py +1 -1
- robotframework-7.0/src/robot/result/model.py +1185 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/modeldeprecation.py +9 -3
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/resultbuilder.py +46 -36
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/xmlelementhandlers.py +83 -43
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/run.py +2 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/__init__.py +14 -4
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/arguments/__init__.py +2 -1
- robotframework-7.0/src/robot/running/arguments/argumentconverter.py +100 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/arguments/argumentmapper.py +26 -24
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/arguments/argumentparser.py +82 -60
- robotframework-7.0/src/robot/running/arguments/argumentresolver.py +158 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/arguments/argumentspec.py +83 -116
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/arguments/argumentvalidator.py +33 -27
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/arguments/customconverters.py +15 -12
- robotframework-7.0/src/robot/running/arguments/embedded.py +145 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/arguments/typeconverters.py +233 -213
- robotframework-7.0/src/robot/running/arguments/typeinfo.py +317 -0
- robotframework-7.0/src/robot/running/arguments/typeinfoparser.py +219 -0
- robotframework-7.0/src/robot/running/arguments/typevalidator.py +60 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/bodyrunner.py +147 -129
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/builder/builders.py +2 -1
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/builder/parsers.py +10 -11
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/builder/settings.py +9 -17
- robotframework-7.0/src/robot/running/builder/transformers.py +535 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/context.py +113 -31
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/dynamicmethods.py +62 -34
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/importer.py +27 -49
- robotframework-7.0/src/robot/running/invalidkeyword.py +67 -0
- robotframework-7.0/src/robot/running/keywordfinder.py +91 -0
- robotframework-7.0/src/robot/running/keywordimplementation.py +164 -0
- robotframework-7.0/src/robot/running/librarykeyword.py +392 -0
- robotframework-7.0/src/robot/running/librarykeywordrunner.py +250 -0
- robotframework-7.0/src/robot/running/libraryscopes.py +115 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/model.py +195 -377
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/namespace.py +124 -137
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/outputcapture.py +20 -12
- robotframework-7.0/src/robot/running/resourcemodel.py +448 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/statusreporter.py +16 -13
- robotframework-7.0/src/robot/running/suiterunner.py +265 -0
- robotframework-7.0/src/robot/running/testlibraries.py +500 -0
- robotframework-7.0/src/robot/running/userkeywordrunner.py +260 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/testdoc.py +18 -13
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/__init__.py +53 -35
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/connectioncache.py +64 -59
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/dotdict.py +3 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/encodingsniffer.py +1 -1
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/escaping.py +19 -19
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/importer.py +2 -2
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/markupwriters.py +23 -15
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/misc.py +1 -2
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/normalizing.py +9 -24
- robotframework-7.0/src/robot/utils/notset.py +33 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/platform.py +15 -5
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/robotio.py +9 -9
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/robotpath.py +1 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/robottime.py +122 -90
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/robottypes.py +21 -31
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/setter.py +0 -5
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/text.py +7 -4
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/unic.py +2 -2
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/__init__.py +2 -2
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/assigner.py +17 -19
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/evaluation.py +20 -17
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/filesetter.py +80 -80
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/replacer.py +33 -36
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/scopes.py +17 -12
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/search.py +66 -41
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/store.py +14 -16
- robotframework-7.0/src/robot/variables/tablesetter.py +164 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/variables.py +1 -1
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/version.py +1 -1
- {robotframework-6.1.1 → robotframework-7.0}/src/robotframework.egg-info/PKG-INFO +6 -8
- {robotframework-6.1.1 → robotframework-7.0}/src/robotframework.egg-info/SOURCES.txt +10 -8
- {robotframework-6.1.1 → robotframework-7.0}/tasks.py +6 -6
- robotframework-6.1.1/src/robot/htmldata/rebot/common.css +0 -239
- robotframework-6.1.1/src/robot/libraries/Reserved.py +0 -48
- robotframework-6.1.1/src/robot/model/keyword.py +0 -173
- robotframework-6.1.1/src/robot/output/console/dotted.py +0 -90
- robotframework-6.1.1/src/robot/output/listenerarguments.py +0 -165
- robotframework-6.1.1/src/robot/output/listenermethods.py +0 -113
- robotframework-6.1.1/src/robot/output/listeners.py +0 -174
- robotframework-6.1.1/src/robot/output/output.py +0 -95
- robotframework-6.1.1/src/robot/output/xmllogger.py +0 -354
- robotframework-6.1.1/src/robot/parsing/model/visitor.py +0 -67
- robotframework-6.1.1/src/robot/result/keywordremover.py +0 -183
- robotframework-6.1.1/src/robot/result/model.py +0 -957
- robotframework-6.1.1/src/robot/running/arguments/argumentconverter.py +0 -79
- robotframework-6.1.1/src/robot/running/arguments/argumentresolver.py +0 -131
- robotframework-6.1.1/src/robot/running/arguments/embedded.py +0 -146
- robotframework-6.1.1/src/robot/running/arguments/typevalidator.py +0 -56
- robotframework-6.1.1/src/robot/running/builder/transformers.py +0 -642
- robotframework-6.1.1/src/robot/running/handlers.py +0 -321
- robotframework-6.1.1/src/robot/running/handlerstore.py +0 -66
- robotframework-6.1.1/src/robot/running/librarykeywordrunner.py +0 -238
- robotframework-6.1.1/src/robot/running/libraryscopes.py +0 -97
- robotframework-6.1.1/src/robot/running/modelcombiner.py +0 -32
- robotframework-6.1.1/src/robot/running/suiterunner.py +0 -248
- robotframework-6.1.1/src/robot/running/testlibraries.py +0 -423
- robotframework-6.1.1/src/robot/running/usererrorhandler.py +0 -75
- robotframework-6.1.1/src/robot/running/userkeyword.py +0 -111
- robotframework-6.1.1/src/robot/running/userkeywordrunner.py +0 -274
- robotframework-6.1.1/src/robot/variables/tablesetter.py +0 -156
- {robotframework-6.1.1 → robotframework-7.0}/AUTHORS.rst +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/BUILD.rst +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/CONTRIBUTING.rst +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/COPYRIGHT.txt +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/LICENSE.txt +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/MANIFEST.in +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/setup.cfg +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/__init__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/__main__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/conf/__init__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/errors.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/__init__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/common/__init__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/common/js_disabled.css +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/jsonwriter.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/lib/__init__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/lib/jquery.highlight.min.js +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/lib/jquery.min.js +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/lib/jquery.tablesorter.min.js +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/lib/jquery.tmpl.min.js +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/lib/jsxcompressor.min.js +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/libdoc/__init__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/libdoc/doc_formatting.css +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/libdoc/print.css +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/libdoc/pygments.css +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/__init__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/fileloading.js +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/log.js +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/print.css +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/util.js +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/testdoc/__init__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/testdoc/testdoc.css +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/testdoc/testdoc.html +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdoc.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/__init__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/consoleviewer.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/htmlwriter.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/jsonwriter.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/output.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/writer.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/Dialogs.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/Easter.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/Screenshot.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/Telnet.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/dialogs_py.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/fixture.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/metadata.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/modifier.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/statistics.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/suitestatistics.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/tagsetter.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/tagstatistics.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/totalstatistics.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/__init__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/console/__init__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/console/highlighting.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/pyloggingconf.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/__init__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/lexer/__init__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/lexer/tokenizer.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/model/__init__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/parser/__init__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/parser/blockparsers.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/parser/fileparser.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/parser/parser.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/suitestructure.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/pythonpathsetter.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/__init__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/jsexecutionresult.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/jswriter.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/executionerrors.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/messagefilter.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/suiteteardownfailed.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/visitor.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/builder/__init__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/randomizer.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/runkwregister.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/signalhandler.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/status.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/timeouts/__init__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/timeouts/posix.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/timeouts/windows.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/application.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/argumentparser.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/asserts.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/charwidth.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/compress.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/encoding.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/error.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/etreewrapper.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/filereader.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/frange.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/htmlformatters.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/markuputils.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/match.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/recommendations.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/restreader.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/robotenv.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/robotinspect.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/sortable.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/typehints.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/finders.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/notfound.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/resolvable.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robotframework.egg-info/dependency_links.txt +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robotframework.egg-info/entry_points.txt +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robotframework.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,448 @@
|
|
|
1
|
+
# Copyright 2008-2015 Nokia Networks
|
|
2
|
+
# Copyright 2016- Robot Framework Foundation
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
|
|
16
|
+
from pathlib import Path
|
|
17
|
+
from typing import Any, Iterable, Literal, overload, Sequence, TYPE_CHECKING
|
|
18
|
+
|
|
19
|
+
from robot import model
|
|
20
|
+
from robot.model import BodyItem, create_fixture, DataDict, ModelObject, Tags
|
|
21
|
+
from robot.output import LOGGER
|
|
22
|
+
from robot.utils import NOT_SET, setter
|
|
23
|
+
|
|
24
|
+
from .arguments import ArgInfo, ArgumentSpec, UserKeywordArgumentParser
|
|
25
|
+
from .keywordimplementation import KeywordImplementation
|
|
26
|
+
from .keywordfinder import KeywordFinder
|
|
27
|
+
from .model import Body, BodyItemParent, Keyword, TestSuite
|
|
28
|
+
from .userkeywordrunner import UserKeywordRunner, EmbeddedArgumentsRunner
|
|
29
|
+
|
|
30
|
+
if TYPE_CHECKING:
|
|
31
|
+
from robot.parsing import File
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class ResourceFile(ModelObject):
|
|
35
|
+
repr_args = ('source',)
|
|
36
|
+
__slots__ = ('_source', 'owner', 'doc', 'keyword_finder')
|
|
37
|
+
|
|
38
|
+
def __init__(self, source: 'Path|str|None' = None,
|
|
39
|
+
owner: 'TestSuite|None' = None,
|
|
40
|
+
doc: str = ''):
|
|
41
|
+
self.source = source
|
|
42
|
+
self.owner = owner
|
|
43
|
+
self.doc = doc
|
|
44
|
+
self.keyword_finder = KeywordFinder['UserKeyword'](self)
|
|
45
|
+
self.imports = []
|
|
46
|
+
self.variables = []
|
|
47
|
+
self.keywords = []
|
|
48
|
+
|
|
49
|
+
@property
|
|
50
|
+
def source(self) -> 'Path|None':
|
|
51
|
+
if self._source:
|
|
52
|
+
return self._source
|
|
53
|
+
if self.owner:
|
|
54
|
+
return self.owner.source
|
|
55
|
+
return None
|
|
56
|
+
|
|
57
|
+
@source.setter
|
|
58
|
+
def source(self, source: 'Path|str|None'):
|
|
59
|
+
if isinstance(source, str):
|
|
60
|
+
source = Path(source)
|
|
61
|
+
self._source = source
|
|
62
|
+
|
|
63
|
+
@property
|
|
64
|
+
def name(self) -> 'str|None':
|
|
65
|
+
"""Resource file name.
|
|
66
|
+
|
|
67
|
+
``None`` if resource file is part of a suite or if it does not have
|
|
68
|
+
:attr:`source`, name of the source file without the extension otherwise.
|
|
69
|
+
"""
|
|
70
|
+
if self.owner or not self.source:
|
|
71
|
+
return None
|
|
72
|
+
return self.source.stem
|
|
73
|
+
|
|
74
|
+
@setter
|
|
75
|
+
def imports(self, imports: Sequence['Import']) -> 'Imports':
|
|
76
|
+
return Imports(self, imports)
|
|
77
|
+
|
|
78
|
+
@setter
|
|
79
|
+
def variables(self, variables: Sequence['Variable']) -> 'Variables':
|
|
80
|
+
return Variables(self, variables)
|
|
81
|
+
|
|
82
|
+
@setter
|
|
83
|
+
def keywords(self, keywords: Sequence['UserKeyword']) -> 'UserKeywords':
|
|
84
|
+
return UserKeywords(self, keywords)
|
|
85
|
+
|
|
86
|
+
@classmethod
|
|
87
|
+
def from_file_system(cls, path: 'Path|str', **config) -> 'ResourceFile':
|
|
88
|
+
"""Create a :class:`ResourceFile` object based on the give ``path``.
|
|
89
|
+
|
|
90
|
+
:param path: File path where to read the data from.
|
|
91
|
+
:param config: Configuration parameters for :class:`~.builders.ResourceFileBuilder`
|
|
92
|
+
class that is used internally for building the suite.
|
|
93
|
+
|
|
94
|
+
New in Robot Framework 6.1. See also :meth:`from_string` and :meth:`from_model`.
|
|
95
|
+
"""
|
|
96
|
+
from .builder import ResourceFileBuilder
|
|
97
|
+
return ResourceFileBuilder(**config).build(path)
|
|
98
|
+
|
|
99
|
+
@classmethod
|
|
100
|
+
def from_string(cls, string: str, **config) -> 'ResourceFile':
|
|
101
|
+
"""Create a :class:`ResourceFile` object based on the given ``string``.
|
|
102
|
+
|
|
103
|
+
:param string: String to create the resource file from.
|
|
104
|
+
:param config: Configuration parameters for
|
|
105
|
+
:func:`~robot.parsing.parser.parser.get_resource_model` used internally.
|
|
106
|
+
|
|
107
|
+
New in Robot Framework 6.1. See also :meth:`from_file_system` and
|
|
108
|
+
:meth:`from_model`.
|
|
109
|
+
"""
|
|
110
|
+
from robot.parsing import get_resource_model
|
|
111
|
+
model = get_resource_model(string, data_only=True, **config)
|
|
112
|
+
return cls.from_model(model)
|
|
113
|
+
|
|
114
|
+
@classmethod
|
|
115
|
+
def from_model(cls, model: 'File') -> 'ResourceFile':
|
|
116
|
+
"""Create a :class:`ResourceFile` object based on the given ``model``.
|
|
117
|
+
|
|
118
|
+
:param model: Model to create the suite from.
|
|
119
|
+
|
|
120
|
+
The model can be created by using the
|
|
121
|
+
:func:`~robot.parsing.parser.parser.get_resource_model` function and possibly
|
|
122
|
+
modified by other tooling in the :mod:`robot.parsing` module.
|
|
123
|
+
|
|
124
|
+
New in Robot Framework 6.1. See also :meth:`from_file_system` and
|
|
125
|
+
:meth:`from_string`.
|
|
126
|
+
"""
|
|
127
|
+
from .builder import RobotParser
|
|
128
|
+
return RobotParser().parse_resource_model(model)
|
|
129
|
+
|
|
130
|
+
@overload
|
|
131
|
+
def find_keywords(self, name: str, count: Literal[1]) -> 'UserKeyword':
|
|
132
|
+
...
|
|
133
|
+
|
|
134
|
+
@overload
|
|
135
|
+
def find_keywords(self, name: str, count: 'int|None' = None) -> 'list[UserKeyword]':
|
|
136
|
+
...
|
|
137
|
+
|
|
138
|
+
def find_keywords(self, name: str, count: 'int|None' = None) \
|
|
139
|
+
-> 'list[UserKeyword]|UserKeyword':
|
|
140
|
+
return self.keyword_finder.find(name, count)
|
|
141
|
+
|
|
142
|
+
def to_dict(self) -> DataDict:
|
|
143
|
+
data = {}
|
|
144
|
+
if self._source:
|
|
145
|
+
data['source'] = str(self._source)
|
|
146
|
+
if self.doc:
|
|
147
|
+
data['doc'] = self.doc
|
|
148
|
+
if self.imports:
|
|
149
|
+
data['imports'] = self.imports.to_dicts()
|
|
150
|
+
if self.variables:
|
|
151
|
+
data['variables'] = self.variables.to_dicts()
|
|
152
|
+
if self.keywords:
|
|
153
|
+
data['keywords'] = self.keywords.to_dicts()
|
|
154
|
+
return data
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
class UserKeyword(KeywordImplementation):
|
|
158
|
+
"""Represents a user keyword."""
|
|
159
|
+
type = KeywordImplementation.USER_KEYWORD
|
|
160
|
+
fixture_class = Keyword
|
|
161
|
+
__slots__ = ['timeout', '_setup', '_teardown']
|
|
162
|
+
|
|
163
|
+
def __init__(self, name: str = '',
|
|
164
|
+
args: 'ArgumentSpec|Sequence[str]|None' = (),
|
|
165
|
+
doc: str = '',
|
|
166
|
+
tags: 'Tags|Sequence[str]' = (),
|
|
167
|
+
timeout: 'str|None' = None,
|
|
168
|
+
lineno: 'int|None' = None,
|
|
169
|
+
owner: 'ResourceFile|None' = None,
|
|
170
|
+
parent: 'BodyItemParent|None' = None,
|
|
171
|
+
error: 'str|None' = None):
|
|
172
|
+
super().__init__(name, args, doc, tags, lineno, owner, parent, error)
|
|
173
|
+
self.timeout = timeout
|
|
174
|
+
self._setup = None
|
|
175
|
+
self._teardown = None
|
|
176
|
+
self.body = []
|
|
177
|
+
|
|
178
|
+
@setter
|
|
179
|
+
def args(self, spec: 'ArgumentSpec|Sequence[str]|None') -> ArgumentSpec:
|
|
180
|
+
if not spec:
|
|
181
|
+
spec = ArgumentSpec()
|
|
182
|
+
elif not isinstance(spec, ArgumentSpec):
|
|
183
|
+
spec = UserKeywordArgumentParser().parse(spec)
|
|
184
|
+
spec.name = lambda: self.full_name
|
|
185
|
+
return spec
|
|
186
|
+
|
|
187
|
+
@setter
|
|
188
|
+
def body(self, body: 'Sequence[BodyItem|DataDict]') -> Body:
|
|
189
|
+
return Body(self, body)
|
|
190
|
+
|
|
191
|
+
@property
|
|
192
|
+
def setup(self) -> Keyword:
|
|
193
|
+
"""User keyword setup as a :class:`Keyword` object.
|
|
194
|
+
|
|
195
|
+
New in Robot Framework 7.0.
|
|
196
|
+
"""
|
|
197
|
+
if self._setup is None:
|
|
198
|
+
self.setup = None
|
|
199
|
+
return self._setup
|
|
200
|
+
|
|
201
|
+
@setup.setter
|
|
202
|
+
def setup(self, setup: 'Keyword|DataDict|None'):
|
|
203
|
+
self._setup = create_fixture(self.fixture_class, setup, self, Keyword.SETUP)
|
|
204
|
+
|
|
205
|
+
@property
|
|
206
|
+
def has_setup(self) -> bool:
|
|
207
|
+
"""Check does a keyword have a setup without creating a setup object.
|
|
208
|
+
|
|
209
|
+
See :attr:`has_teardown` for more information. New in Robot Framework 7.0.
|
|
210
|
+
"""
|
|
211
|
+
return bool(self._setup)
|
|
212
|
+
|
|
213
|
+
@property
|
|
214
|
+
def teardown(self) -> Keyword:
|
|
215
|
+
"""User keyword teardown as a :class:`Keyword` object."""
|
|
216
|
+
if self._teardown is None:
|
|
217
|
+
self.teardown = None
|
|
218
|
+
return self._teardown
|
|
219
|
+
|
|
220
|
+
@teardown.setter
|
|
221
|
+
def teardown(self, teardown: 'Keyword|DataDict|None'):
|
|
222
|
+
self._teardown = create_fixture(self.fixture_class, teardown, self, Keyword.TEARDOWN)
|
|
223
|
+
|
|
224
|
+
@property
|
|
225
|
+
def has_teardown(self) -> bool:
|
|
226
|
+
"""Check does a keyword have a teardown without creating a teardown object.
|
|
227
|
+
|
|
228
|
+
A difference between using ``if kw.has_teardown:`` and ``if kw.teardown:``
|
|
229
|
+
is that accessing the :attr:`teardown` attribute creates a :class:`Keyword`
|
|
230
|
+
object representing the teardown even when the user keyword actually does
|
|
231
|
+
not have one. This can have an effect on memory usage.
|
|
232
|
+
|
|
233
|
+
New in Robot Framework 6.1.
|
|
234
|
+
"""
|
|
235
|
+
return bool(self._teardown)
|
|
236
|
+
|
|
237
|
+
def create_runner(self, name: 'str|None', languages=None) \
|
|
238
|
+
-> 'UserKeywordRunner|EmbeddedArgumentsRunner':
|
|
239
|
+
if self.embedded:
|
|
240
|
+
return EmbeddedArgumentsRunner(self, name)
|
|
241
|
+
return UserKeywordRunner(self)
|
|
242
|
+
|
|
243
|
+
def bind(self, data: Keyword) -> 'UserKeyword':
|
|
244
|
+
kw = UserKeyword('', self.args.copy(), self.doc, self.tags, self.timeout,
|
|
245
|
+
self.lineno, self.owner, data.parent, self.error)
|
|
246
|
+
# Avoid possible errors setting name with invalid embedded args.
|
|
247
|
+
kw._name = self._name
|
|
248
|
+
kw.embedded = self.embedded
|
|
249
|
+
if self.has_setup:
|
|
250
|
+
kw.setup = self.setup.to_dict()
|
|
251
|
+
if self.has_teardown:
|
|
252
|
+
kw.teardown = self.teardown.to_dict()
|
|
253
|
+
kw.body = self.body.to_dicts()
|
|
254
|
+
return kw
|
|
255
|
+
|
|
256
|
+
def to_dict(self) -> DataDict:
|
|
257
|
+
data: DataDict = {'name': self.name}
|
|
258
|
+
for name, value in [('args', tuple(self._decorate_arg(a) for a in self.args)),
|
|
259
|
+
('doc', self.doc),
|
|
260
|
+
('tags', tuple(self.tags)),
|
|
261
|
+
('timeout', self.timeout),
|
|
262
|
+
('lineno', self.lineno),
|
|
263
|
+
('error', self.error)]:
|
|
264
|
+
if value:
|
|
265
|
+
data[name] = value
|
|
266
|
+
if self.has_setup:
|
|
267
|
+
data['setup'] = self.setup.to_dict()
|
|
268
|
+
data['body'] = self.body.to_dicts()
|
|
269
|
+
if self.has_teardown:
|
|
270
|
+
data['teardown'] = self.teardown.to_dict()
|
|
271
|
+
return data
|
|
272
|
+
|
|
273
|
+
def _decorate_arg(self, arg: ArgInfo) -> str:
|
|
274
|
+
if arg.kind == arg.VAR_NAMED:
|
|
275
|
+
deco = '&'
|
|
276
|
+
elif arg.kind in (arg.VAR_POSITIONAL, arg.NAMED_ONLY_MARKER):
|
|
277
|
+
deco = '@'
|
|
278
|
+
else:
|
|
279
|
+
deco = '$'
|
|
280
|
+
result = f'{deco}{{{arg.name}}}'
|
|
281
|
+
if arg.default is not NOT_SET:
|
|
282
|
+
result += f'={arg.default}'
|
|
283
|
+
return result
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
class Variable(ModelObject):
|
|
287
|
+
repr_args = ('name', 'value', 'separator')
|
|
288
|
+
|
|
289
|
+
def __init__(self, name: str = '',
|
|
290
|
+
value: Sequence[str] = (),
|
|
291
|
+
separator: 'str|None' = None,
|
|
292
|
+
owner: 'ResourceFile|None' = None,
|
|
293
|
+
lineno: 'int|None' = None,
|
|
294
|
+
error: 'str|None' = None):
|
|
295
|
+
self.name = name
|
|
296
|
+
self.value = tuple(value)
|
|
297
|
+
self.separator = separator
|
|
298
|
+
self.owner = owner
|
|
299
|
+
self.lineno = lineno
|
|
300
|
+
self.error = error
|
|
301
|
+
|
|
302
|
+
@property
|
|
303
|
+
def source(self) -> 'Path|None':
|
|
304
|
+
return self.owner.source if self.owner is not None else None
|
|
305
|
+
|
|
306
|
+
def report_error(self, message: str, level: str = 'ERROR'):
|
|
307
|
+
source = self.source or '<unknown>'
|
|
308
|
+
line = f' on line {self.lineno}' if self.lineno else ''
|
|
309
|
+
LOGGER.write(f"Error in file '{source}'{line}: "
|
|
310
|
+
f"Setting variable '{self.name}' failed: {message}", level)
|
|
311
|
+
|
|
312
|
+
def to_dict(self) -> DataDict:
|
|
313
|
+
data = {'name': self.name, 'value': self.value}
|
|
314
|
+
if self.lineno:
|
|
315
|
+
data['lineno'] = self.lineno
|
|
316
|
+
if self.error:
|
|
317
|
+
data['error'] = self.error
|
|
318
|
+
return data
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
class Import(ModelObject):
|
|
322
|
+
repr_args = ('type', 'name', 'args', 'alias')
|
|
323
|
+
LIBRARY = 'LIBRARY'
|
|
324
|
+
RESOURCE = 'RESOURCE'
|
|
325
|
+
VARIABLES = 'VARIABLES'
|
|
326
|
+
|
|
327
|
+
def __init__(self, type: Literal['LIBRARY', 'RESOURCE', 'VARIABLES'],
|
|
328
|
+
name: str,
|
|
329
|
+
args: Sequence[str] = (),
|
|
330
|
+
alias: 'str|None' = None,
|
|
331
|
+
owner: 'ResourceFile|None' = None,
|
|
332
|
+
lineno: 'int|None' = None):
|
|
333
|
+
if type not in (self.LIBRARY, self.RESOURCE, self.VARIABLES):
|
|
334
|
+
raise ValueError(f"Invalid import type: Expected '{self.LIBRARY}', "
|
|
335
|
+
f"'{self.RESOURCE}' or '{self.VARIABLES}', got '{type}'.")
|
|
336
|
+
self.type = type
|
|
337
|
+
self.name = name
|
|
338
|
+
self.args = tuple(args)
|
|
339
|
+
self.alias = alias
|
|
340
|
+
self.owner = owner
|
|
341
|
+
self.lineno = lineno
|
|
342
|
+
|
|
343
|
+
@property
|
|
344
|
+
def source(self) -> 'Path|None':
|
|
345
|
+
return self.owner.source if self.owner is not None else None
|
|
346
|
+
|
|
347
|
+
@property
|
|
348
|
+
def directory(self) -> 'Path|None':
|
|
349
|
+
source = self.source
|
|
350
|
+
return source.parent if source and not source.is_dir() else source
|
|
351
|
+
|
|
352
|
+
@property
|
|
353
|
+
def setting_name(self) -> str:
|
|
354
|
+
return self.type.title()
|
|
355
|
+
|
|
356
|
+
def select(self, library: Any, resource: Any, variables: Any) -> Any:
|
|
357
|
+
return {self.LIBRARY: library,
|
|
358
|
+
self.RESOURCE: resource,
|
|
359
|
+
self.VARIABLES: variables}[self.type]
|
|
360
|
+
|
|
361
|
+
def report_error(self, message: str, level: str = 'ERROR'):
|
|
362
|
+
source = self.source or '<unknown>'
|
|
363
|
+
line = f' on line {self.lineno}' if self.lineno else ''
|
|
364
|
+
LOGGER.write(f"Error in file '{source}'{line}: {message}", level)
|
|
365
|
+
|
|
366
|
+
@classmethod
|
|
367
|
+
def from_dict(cls, data) -> 'Import':
|
|
368
|
+
return cls(**data)
|
|
369
|
+
|
|
370
|
+
def to_dict(self) -> DataDict:
|
|
371
|
+
data: DataDict = {'type': self.type, 'name': self.name}
|
|
372
|
+
if self.args:
|
|
373
|
+
data['args'] = self.args
|
|
374
|
+
if self.alias:
|
|
375
|
+
data['alias'] = self.alias
|
|
376
|
+
if self.lineno:
|
|
377
|
+
data['lineno'] = self.lineno
|
|
378
|
+
return data
|
|
379
|
+
|
|
380
|
+
def _include_in_repr(self, name: str, value: Any) -> bool:
|
|
381
|
+
return name in ('type', 'name') or value
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
class Imports(model.ItemList):
|
|
385
|
+
|
|
386
|
+
def __init__(self, owner: ResourceFile, imports: Sequence[Import] = ()):
|
|
387
|
+
super().__init__(Import, {'owner': owner}, items=imports)
|
|
388
|
+
|
|
389
|
+
def library(self, name: str, args: Sequence[str] = (), alias: 'str|None' = None,
|
|
390
|
+
lineno: 'int|None' = None) -> Import:
|
|
391
|
+
"""Create library import."""
|
|
392
|
+
return self.create(Import.LIBRARY, name, args, alias, lineno=lineno)
|
|
393
|
+
|
|
394
|
+
def resource(self, name: str, lineno: 'int|None' = None) -> Import:
|
|
395
|
+
"""Create resource import."""
|
|
396
|
+
return self.create(Import.RESOURCE, name, lineno=lineno)
|
|
397
|
+
|
|
398
|
+
def variables(self, name: str, args: Sequence[str] = (),
|
|
399
|
+
lineno: 'int|None' = None) -> Import:
|
|
400
|
+
"""Create variables import."""
|
|
401
|
+
return self.create(Import.VARIABLES, name, args, lineno=lineno)
|
|
402
|
+
|
|
403
|
+
def create(self, *args, **kwargs) -> Import:
|
|
404
|
+
"""Generic method for creating imports.
|
|
405
|
+
|
|
406
|
+
Import type specific methods :meth:`library`, :meth:`resource` and
|
|
407
|
+
:meth:`variables` are recommended over this method.
|
|
408
|
+
"""
|
|
409
|
+
# RF 6.1 changed types to upper case. Code below adds backwards compatibility.
|
|
410
|
+
if args:
|
|
411
|
+
args = (args[0].upper(),) + args[1:]
|
|
412
|
+
elif 'type' in kwargs:
|
|
413
|
+
kwargs['type'] = kwargs['type'].upper()
|
|
414
|
+
return super().create(*args, **kwargs)
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
class Variables(model.ItemList[Variable]):
|
|
418
|
+
|
|
419
|
+
def __init__(self, owner: ResourceFile, variables: Sequence[Variable] = ()):
|
|
420
|
+
super().__init__(Variable, {'owner': owner}, items=variables)
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
class UserKeywords(model.ItemList[UserKeyword]):
|
|
424
|
+
|
|
425
|
+
def __init__(self, owner: ResourceFile, keywords: Sequence[UserKeyword] = ()):
|
|
426
|
+
self.invalidate_keyword_cache = owner.keyword_finder.invalidate_cache
|
|
427
|
+
self.invalidate_keyword_cache()
|
|
428
|
+
super().__init__(UserKeyword, {'owner': owner}, items=keywords)
|
|
429
|
+
|
|
430
|
+
def append(self, item: 'UserKeyword|DataDict') -> UserKeyword:
|
|
431
|
+
self.invalidate_keyword_cache()
|
|
432
|
+
return super().append(item)
|
|
433
|
+
|
|
434
|
+
def extend(self, items: 'Iterable[UserKeyword|DataDict]'):
|
|
435
|
+
self.invalidate_keyword_cache()
|
|
436
|
+
return super().extend(items)
|
|
437
|
+
|
|
438
|
+
def __setitem__(self, index: 'int|slice', item: 'Iterable[UserKeyword|DataDict]'):
|
|
439
|
+
self.invalidate_keyword_cache()
|
|
440
|
+
return super().__setitem__(index, item)
|
|
441
|
+
|
|
442
|
+
def insert(self, index: int, item: 'UserKeyword|DataDict'):
|
|
443
|
+
self.invalidate_keyword_cache()
|
|
444
|
+
super().insert(index, item)
|
|
445
|
+
|
|
446
|
+
def clear(self):
|
|
447
|
+
self.invalidate_keyword_cache()
|
|
448
|
+
super().clear()
|
|
@@ -13,18 +13,20 @@
|
|
|
13
13
|
# See the License for the specific language governing permissions and
|
|
14
14
|
# limitations under the License.
|
|
15
15
|
|
|
16
|
-
from
|
|
17
|
-
HandlerExecutionFailed)
|
|
18
|
-
from robot.utils import ErrorDetails, get_timestamp
|
|
16
|
+
from datetime import datetime
|
|
19
17
|
|
|
20
|
-
from .
|
|
18
|
+
from robot.errors import (BreakLoop, ContinueLoop, DataError, ExecutionFailed,
|
|
19
|
+
ExecutionStatus, HandlerExecutionFailed, ReturnFromKeyword)
|
|
20
|
+
from robot.utils import ErrorDetails
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
class StatusReporter:
|
|
24
24
|
|
|
25
|
-
def __init__(self, data, result, context, run=True, suppress=False
|
|
25
|
+
def __init__(self, data, result, context, run=True, suppress=False,
|
|
26
|
+
implementation=None):
|
|
26
27
|
self.data = data
|
|
27
28
|
self.result = result
|
|
29
|
+
self.implementation = implementation
|
|
28
30
|
self.context = context
|
|
29
31
|
if run:
|
|
30
32
|
self.pass_status = result.PASS
|
|
@@ -38,16 +40,17 @@ class StatusReporter:
|
|
|
38
40
|
context = self.context
|
|
39
41
|
result = self.result
|
|
40
42
|
self.initial_test_status = context.test.status if context.test else None
|
|
41
|
-
if not result.
|
|
42
|
-
result.
|
|
43
|
-
context.
|
|
44
|
-
|
|
43
|
+
if not result.start_time:
|
|
44
|
+
result.start_time = datetime.now()
|
|
45
|
+
context.start_body_item(self.data, result, self.implementation)
|
|
46
|
+
if result.type in result.KEYWORD_TYPES:
|
|
47
|
+
self._warn_if_deprecated(result.doc, result.full_name)
|
|
45
48
|
return self
|
|
46
49
|
|
|
47
50
|
def _warn_if_deprecated(self, doc, name):
|
|
48
51
|
if doc.startswith('*DEPRECATED') and '*' in doc[1:]:
|
|
49
52
|
message = ' ' + doc.split('*', 2)[-1].strip()
|
|
50
|
-
self.context.warn("Keyword '
|
|
53
|
+
self.context.warn(f"Keyword '{name}' is deprecated.{message}")
|
|
51
54
|
|
|
52
55
|
def __exit__(self, exc_type, exc_val, exc_tb):
|
|
53
56
|
context = self.context
|
|
@@ -57,12 +60,12 @@ class StatusReporter:
|
|
|
57
60
|
result.status = self.pass_status
|
|
58
61
|
else:
|
|
59
62
|
result.status = failure.status
|
|
60
|
-
if
|
|
63
|
+
if not isinstance(failure, (BreakLoop, ContinueLoop, ReturnFromKeyword)):
|
|
61
64
|
result.message = failure.message
|
|
62
65
|
if self.initial_test_status == 'PASS':
|
|
63
66
|
context.test.status = result.status
|
|
64
|
-
result.
|
|
65
|
-
context.
|
|
67
|
+
result.elapsed_time = datetime.now() - result.start_time
|
|
68
|
+
context.end_body_item(self.data, result, self.implementation)
|
|
66
69
|
if failure is not exc_val and not self.suppress:
|
|
67
70
|
raise failure
|
|
68
71
|
return self.suppress
|