From d2d519666250324478bdccd7ccd65206a9110bf4 Mon Sep 17 00:00:00 2001 From: Rene Date: Sat, 8 Jun 2024 17:36:39 +0300 Subject: [PATCH] fixed RF 7.0.1 compatibility Signed-off-by: Rene --- src/DataDriver/DataDriver.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/DataDriver/DataDriver.py b/src/DataDriver/DataDriver.py index bc2055f..75f8424 100644 --- a/src/DataDriver/DataDriver.py +++ b/src/DataDriver/DataDriver.py @@ -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