robotframework-nl 2.2.1__tar.gz → 3.0.0__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: robotframework-nl
3
- Version: 2.2.1
3
+ Version: 3.0.0
4
4
  Summary: robotnl is a proving ground to boost Robot framework closer to Natural Language.
5
5
  Author-email: Johan Foederer <github@famfoe.nl>
6
6
  License: BSD 3-Clause License
@@ -41,7 +41,7 @@ Classifier: Operating System :: OS Independent
41
41
  Requires-Python: >=3.8
42
42
  Description-Content-Type: text/markdown
43
43
  License-File: LICENSE
44
- Requires-Dist: robotframework>=6.0
44
+ Requires-Dist: robotframework>=7.0
45
45
 
46
46
  # robotframeworkNL - the oneliner
47
47
  robotframeworkNL is a proving ground to boost Robot framework closer to Natural Language.
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
7
7
 
8
8
  [project]
9
9
  name = "robotframework-nl"
10
- version = "2.2.1"
10
+ version = "3.0.0"
11
11
  description = "robotnl is a proving ground to boost Robot framework closer to Natural Language."
12
12
  readme = "README.md"
13
13
  authors = [{ name = "Johan Foederer", email = "github@famfoe.nl" }]
@@ -19,7 +19,7 @@ classifiers = [
19
19
  ]
20
20
  keywords = ["robotframework", "robot", "testing", "dsl"]
21
21
  dependencies = [
22
- "robotframework >= 6.0",
22
+ "robotframework >= 7.0",
23
23
  ]
24
24
  requires-python = ">=3.8"
25
25
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: robotframework-nl
3
- Version: 2.2.1
3
+ Version: 3.0.0
4
4
  Summary: robotnl is a proving ground to boost Robot framework closer to Natural Language.
5
5
  Author-email: Johan Foederer <github@famfoe.nl>
6
6
  License: BSD 3-Clause License
@@ -41,7 +41,7 @@ Classifier: Operating System :: OS Independent
41
41
  Requires-Python: >=3.8
42
42
  Description-Content-Type: text/markdown
43
43
  License-File: LICENSE
44
- Requires-Dist: robotframework>=6.0
44
+ Requires-Dist: robotframework>=7.0
45
45
 
46
46
  # robotframeworkNL - the oneliner
47
47
  robotframeworkNL is a proving ground to boost Robot framework closer to Natural Language.
@@ -0,0 +1 @@
1
+ robotframework>=7.0
@@ -30,6 +30,7 @@
30
30
  # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31
31
  # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
32
 
33
+ from robot.api import TypeInfo
33
34
  from robot.libraries.BuiltIn import BuiltIn
34
35
  from robot.running.arguments import TypeConverter
35
36
 
@@ -195,10 +196,10 @@ class OperatorProxy:
195
196
  returns type casted otherValue
196
197
  """
197
198
  CastedOther = otherValue # By default leave untouched
198
- converter = TypeConverter.converter_for(type(leadingValue))
199
+ converter = TypeConverter.converter_for(TypeInfo.from_type(type(leadingValue)))
199
200
  if converter:
200
201
  try:
201
- CastedOther = converter.convert(name, otherValue, explicit_type=False)
202
+ CastedOther = converter.convert(otherValue, name)
202
203
  except ValueError as err:
203
204
  BuiltIn().log(err, level='DEBUG')
204
205
  BuiltIn().log(f"Comparing as {converter.type_name} values")
@@ -32,8 +32,7 @@
32
32
 
33
33
  from robot.libraries.BuiltIn import BuiltIn
34
34
  from robot.api.deco import keyword as robot_keyword
35
- from robot.api import logger
36
- from robot.utils import type_repr
35
+ from robot.utils import type_name
37
36
  from robot.running.arguments import TypeConverter
38
37
 
39
38
  from functools import wraps
@@ -81,7 +80,6 @@ class InlineKeyword(Generic[TypeVar('T')]):
81
80
  Inline keywords are keywords that are used as argument to other keywords. The keyword will be
82
81
  evaluated and its return value used as the actual argument.
83
82
  """
84
- _name = 'inline keyword'
85
83
 
86
84
 
87
85
  # work around for Libdoc
@@ -97,24 +95,21 @@ class InlineKeywordConverter(TypeConverter):
97
95
  type = InlineKeyword
98
96
  type_name = 'InlineKeyword'
99
97
 
100
- def __init__(self, used_type, custom_converters=None, languages=None):
101
- super().__init__(used_type, custom_converters, languages)
102
- types = self._get_nested_types(used_type, expected_count=1)
103
- if not types:
104
- self.converter = None
105
- else:
106
- self.type_name = type_repr(used_type)
107
- self.converter = self.converter_for(types[0], custom_converters, languages)
98
+ def __init__(self, type_info, custom_converters=None, languages=None):
99
+ super().__init__(type_info, custom_converters, languages)
100
+ self.converter = self.converter_for(self.type_info.nested[0])
101
+ self.type_name = f"keyword returning {type_name(self.type_info.nested[0].type)}"
108
102
 
109
- def _convert(self, value, explicit_type=True):
103
+ def _convert(self, value):
110
104
  if not is_keyword(value):
111
105
  raise ValueError
112
106
  BuiltIn().log(f"Evaluating argument as keyword [{value}]")
113
107
  result = BuiltIn().run_keyword(value)
114
108
  BuiltIn().log(f"{value} → {result}")
115
109
  if self.converter:
110
+ # Convert the return type of the keyword to the expected type
116
111
  try:
117
- result = self.converter.convert(f"result of: {value}", result, explicit_type)
112
+ result = self.converter.convert(result, f"result of: {value}")
118
113
  except ValueError as err:
119
114
  BuiltIn().log(f"Incorrect keyword return type: {err}")
120
115
  raise
@@ -0,0 +1 @@
1
+ VERSION = '3.0.0'
@@ -1 +0,0 @@
1
- robotframework>=6.0
@@ -1 +0,0 @@
1
- VERSION = '2.2.1'