Skip to content

Commit

Permalink
Merge pull request #108 from Achllle/fix/test_bagfile_topic
Browse files Browse the repository at this point in the history
Retry reading bag file messages without backslash in unit tests
  • Loading branch information
pschillinger committed Feb 9, 2020
2 parents c06c6f4 + a3c9373 commit 86c80ec
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion flexbe_testing/src/flexbe_testing/data_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ def parse(self, value):
# message data
if (isinstance(value, str) and len(value) > 1 and value[0] == '/' and value[1] != '/' and
self._bag is not None):
(_, result, _) = list(self._bag.read_messages(topics=[value]))[0]
try:
(_, result, _) = list(self._bag.read_messages(topics=[value]))[0]
except IndexError:
(_, result, _) = list(self._bag.read_messages(topics=[value[1:]]))[0]
# anonymous function
elif isinstance(value, str) and value.startswith('lambda '):
result = eval(value)
Expand Down

0 comments on commit 86c80ec

Please sign in to comment.