Fix message_tester.py
Make skill optional and disable expected_dialog if missing.
@@ -286,12 +286,13 @@ class EvaluationRule(object):
powerfull/individual test cases than the standard dictionaly
"""
- def __init__(self, test_case, skill):
+ def __init__(self, test_case, skill=None):
"""
Convert test_case read from file to internal rule format
Args:
test_case: The loaded test case
+ skill: optional skill to test, used to fetch dialogs
"""
self.rule = []
@@ -318,6 +319,9 @@ class EvaluationRule(object):
str(test_case['expected_response'])])
if test_case.get('expected_dialog', None):
+ if not skill:
+ print('Skill is missing, can\'t run expected_dialog test')
+ else:
# Make sure expected dialog file is used
dialog = test_case['expected_dialog']
# Extract dialog texts from skill
