Skip to content

Commit

Permalink
fixed RF 7.0.1 compatibility
Browse files Browse the repository at this point in the history
Signed-off-by: Rene <snooz@posteo.de>
  • Loading branch information
Snooz82 committed Jun 8, 2024
1 parent e6eeb75 commit d2d5196
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/DataDriver/DataDriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -1870,12 +1870,18 @@ def _replace_test_case_keywords(self):

def _get_template_arguments(self) -> Union[List[Any], Dict[str, Any]]:
is_rf_7 = isinstance(self.template_keyword.args, ArgumentSpec)
try:
from robot.running.model import Argument # handling new RF 7.0.1 #5000
except ImportError:
class Argument(tuple):
def __new__(cls, name, value):
return tuple.__new__(cls, (name, value))
if is_rf_7:
keyword_arguments = []
for arg in self.template_keyword.args:
arg_name = f"${{{arg.name}}}"
if arg_name in self.test_case_data.arguments:
keyword_arguments.append((arg.name, self.test_case_data.arguments[arg_name]))
keyword_arguments.append(Argument(arg.name, self.test_case_data.arguments[arg_name]))
elif arg.required:
raise ValueError(f"Unassigned requiered argument detected: {arg_name}.")
return keyword_arguments
Expand Down

0 comments on commit d2d5196

Please sign in to comment.