Skip to content

Commit

Permalink
Fix for keywords with no body (such as BREAK)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vernon Crabtree committed Dec 12, 2023
1 parent 26abc2f commit 5c62e10
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,14 @@ def _populate_example_to_body(self, body, target):
**extra_args)
else:
new_kw = kw.deepcopy()
new_kw.body = None
if hasattr(new_kw, 'values'):
new_kw.values = self.replace_list(kw.values)
if hasattr(new_kw, 'condition'):
new_kw.condition = self.variables.replace_scalar(kw.condition, ignore_errors=True)
# TODO: replacement for IF is also necessary - I currently don't have an example of this use-case to test
self._populate_example_to_body(kw.body, new_kw.body)
if hasattr(kw, "body"):
new_kw.body = None
self._populate_example_to_body(kw.body, new_kw.body)
target.append(new_kw)

def replace_list(self, args):
Expand Down
11 changes: 11 additions & 0 deletions Tests/a test.robot
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,14 @@ My test with examples for ${name}
... Joe the world!
... Arthur Camelot (clip clop).
... Patsy it's only a model!
Test of break ${What shall we break}
FOR ${x} IN a b
Log Breaking ${What shall we break} console=True
BREAK
END
Examples: What shall we break --
... Guitar
... Piano
... Niels head

0 comments on commit 5c62e10

Please sign in to comment.