From 46321afb0683d23d3c04d05e097c35b93daa0f06 Mon Sep 17 00:00:00 2001 From: "J. Foederer" <32476108+JFoederer@users.noreply.github.com> Date: Tue, 8 Dec 2020 20:39:17 +0100 Subject: [PATCH] Update test suite to match latest Robot and Python versions Fixes all but 1 test, but only under the condition that also the _convert method in Robot's Remote.py is update to automatically convert bytes to unicode whenever possible. Without updating Robot's Remote.py 5 tests still fail. --- test/atest/argument_spec_invalid.robot | 6 +++--- test/atest/argument_types.robot | 2 +- test/atest/basic_communication.robot | 7 ++++--- test/atest/kwargs.robot | 2 +- test/atest/logging.robot | 2 +- test/atest/module.robot | 7 ++++--- test/atest/returning.robot | 2 +- 7 files changed, 15 insertions(+), 13 deletions(-) diff --git a/test/atest/argument_spec_invalid.robot b/test/atest/argument_spec_invalid.robot index f3de4d3..cb25b03 100644 --- a/test/atest/argument_spec_invalid.robot +++ b/test/atest/argument_spec_invalid.robot @@ -29,15 +29,15 @@ Too few arguments when using varargs Required Defaults And Varargs Using arguments when only kwargs accepted - [Documentation] FAIL Keyword 'Remote.Kwargs' expected 0 non-keyword arguments, got 4. + [Documentation] FAIL Keyword 'Remote.Kwargs' expected 0 non-named arguments, got 4. Kwargs normal args are no-no Too few arguments when kwargs accepted - [Documentation] FAIL Keyword 'Remote.Args And Kwargs' expected 1 to 2 non-keyword arguments, got 0. + [Documentation] FAIL Keyword 'Remote.Args And Kwargs' expected 1 to 2 non-named arguments, got 0. Args and kwargs Too many arguments when kwargs accepted - [Documentation] FAIL Keyword 'Remote.Args And Kwargs' expected 1 to 2 non-keyword arguments, got 7. + [Documentation] FAIL Keyword 'Remote.Args And Kwargs' expected 1 to 2 non-named arguments, got 7. Args and kwargs we do not accept this many args Missing argument when using kwargs diff --git a/test/atest/argument_types.robot b/test/atest/argument_types.robot index 6725d64..73c8ba4 100644 --- a/test/atest/argument_types.robot +++ b/test/atest/argument_types.robot @@ -57,7 +57,7 @@ List-like () [] ('Hei', u'\\xe4iti', 63, (), None) ['Hei', u'\\xe4iti', 63, [], ''] set(['hello']) ['hello'] - xrange(5) [0, 1, 2, 3, 4] + range(5) [0, 1, 2, 3, 4] Dictionary {} diff --git a/test/atest/basic_communication.robot b/test/atest/basic_communication.robot index 98cb75f..445f391 100644 --- a/test/atest/basic_communication.robot +++ b/test/atest/basic_communication.robot @@ -32,9 +32,10 @@ Use multiple times ... LOG 1.1.2 Round 1 ... LOG 1.2.2 Round 2 ... LOG 1.${COUNT}.2 Round ${COUNT} - : FOR ${i} IN RANGE ${COUNT} - \ Passing - \ Logging Round ${i + 1} + FOR ${i} IN RANGE ${COUNT} + Passing + Logging Round ${i + 1} + END Private methods should ne ignored [Documentation] FAIL No keyword with name 'Private Method' found. diff --git a/test/atest/kwargs.robot b/test/atest/kwargs.robot index d4ded3f..957edde 100644 --- a/test/atest/kwargs.robot +++ b/test/atest/kwargs.robot @@ -61,4 +61,4 @@ Non-string kwargs Binary kwargs ${tuple} = Evaluate ('\x02',) ${result} = Kwargs a=\x00 b=\x01 c=${tuple} - Should Match ${result} a:\x00, b:\x01, c:[*'\\x02'] (list) + Should be equal ${result} a:\x00, b:\x01, c:[b'\\x02'] (list) diff --git a/test/atest/logging.robot b/test/atest/logging.robot index f35f3a8..91079ef 100644 --- a/test/atest/logging.robot +++ b/test/atest/logging.robot @@ -38,7 +38,7 @@ Multiple messages with different levels [Documentation] ... LOG 1:1 INFO Info message ... LOG 1:2 DEBUG Debug message - ... LOG 1:3 INFO Second info\n this time with two lines + ... LOG 1:3 INFO Second info\nthis time with two lines ... LOG 1:4 INFO Third info ... LOG 1:5 WARN Warning Multiple Messages With Different Levels diff --git a/test/atest/module.robot b/test/atest/module.robot index 4a326b8..d16aabb 100644 --- a/test/atest/module.robot +++ b/test/atest/module.robot @@ -32,9 +32,10 @@ Use multiple times ... LOG 1.1.2 Round 1 ... LOG 1.2.2 Round 2 ... LOG 1.${COUNT}.2 Round ${COUNT} - : FOR ${i} IN RANGE ${COUNT} - \ Passing - \ Logging Round ${i + 1} + FOR ${i} IN RANGE ${COUNT} + Passing + Logging Round ${i + 1} + END Private methods should ne ignored [Documentation] FAIL No keyword with name 'Private Method' found. diff --git a/test/atest/returning.robot b/test/atest/returning.robot index 6c236e7..d14e0f2 100644 --- a/test/atest/returning.robot +++ b/test/atest/returning.robot @@ -96,7 +96,7 @@ Dictionary with binary keys is not supported {u'\\x00': 'value'} Dictionary with binary values - {'0': u'\\x00', '1': b'\\x01'} + {'0': u'\\x00', '1': b'\\xff'} Dictionary with non-string keys and values [Documentation] XML-RPC supports only strings as keys so must convert them