forked from robotframework/PythonRemoteServer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreturning.robot
More file actions
120 lines (95 loc) · 3.16 KB
/
Copy pathreturning.robot
File metadata and controls
120 lines (95 loc) · 3.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
*** Settings ***
Resource resource.robot
Suite Setup Start And Import Remote Library Returning.py
Suite Teardown Stop Remote Library test logging='ipy' not in '${INTERPRETER}'
Test Template Return Value Should Be
*** Test Cases ***
Empty string
u''
''
ASCII string
u'Hello, world!'
'Hello, world!'
Non-ASCII String
u'Hyv\\xe4'
u'\\u2603'
Non-ASCII Bytes
b'Hyv\\xe4'
b'\\x80\\xff'
Binary
b'\\x00\\x01\\x02'
u'\\x00\\x01\\x02'
b'\\x00\\xe4\\xff'
Unrepresentable binary
[Documentation] FAIL REGEXP: ValueError: Cannot represent (u'\\\\x00\\\\xe4\\\\xff'|'\\\\x00äÿ') as binary.
[Template] Return Evaluated
u'\\x00\\xe4\\xff'
Integer
42
-1
0
Float
3.14
-0.1e10
0.0
Boolean
True
False
None
[Documentation] None is converted to empty string because it is not supported by all XML-RPC versions.
None ''
Custom object
[Documentation] Arbitrary objects cannot be transferred over XML-RPC and thus only their string presentation is used
MyObject() '<MyObject>'
MyObject('xxx') 'xxx'
Custom object with non-ASCII representation
MyObject(u'hyv\\xe4') u'hyv\\xe4'
Custom object with binary representation
MyObject('\\x00\\x01') '\\x00\\x01'
List
\[]
\['Hei', u'\\xe4iti', 63, True, '\\x00']
\[None, MyObject('xxx'), MyObject(u'\\xe4')] ['', 'xxx', u'\\xe4']
\[[0, [[]]], [1, 2], [[True], False], 'xxx']
List-like
[Documentation] Tuples etc. are converted to lists
() []
('Hei', u'\\xe4iti', 63, (), None) ['Hei', u'\\xe4iti', 63, [], '']
set(['hello']) ['hello']
(i for i in range(5)) [0, 1, 2, 3, 4]
Dictionary
{}
{'a': 1, u'b': 2, 'nested': {'k': 'v'}}
{'x': None} {'x': ''}
Dictionary with non-ASCII keys and values
[Tags] no-ipy
{u'\\xe4': u'\\xe4', u'\\u2603': u'\\u2603'}
Dictionary with non-ASCII byte keys is not supported
[Documentation] FAIL GLOB: TypeError: *unhashable*
[Template] Return Evaluated
{b'\\xe4': 'value'}
Dictionary with non-ASCII byte values
{'key': b'\\xe4'}
Dictionary with binary keys is not supported
[Documentation] FAIL GLOB: TypeError: *unhashable*
[Template] Return Evaluated
{u'\\x00': 'value'}
Dictionary with binary values
{'0': u'\\x00', '1': b'\\x01'}
Dictionary with non-string keys and values
[Documentation] XML-RPC supports only strings as keys so must convert them
{42: 42, True: False, None: None} {'42': 42, 'True': False, '': ''}
{MyObject('key'): MyObject('value')} {'key': 'value'}
Dictionary with non-string keys and values with non-ASCII string representation
[Tags] no-ipy
{MyObject(u'\\xe4'): MyObject(u'\\xe4')} {u'\\xe4': u'\\xe4'}
Custom mapping
MyMapping() {}
MyMapping({'x': MyMapping(), 'y': None}) {'x': {}, 'y': ''}
*** Keywords ***
Return Value Should Be
[Arguments] ${value} ${expected}=
${actual} = Return Evaluated ${value}
${expected} = Set Variable If $expected ${expected} ${value}
${expected} = Evaluate ${expected}
Should Be Equal ${actual} ${expected}