spiff-arena/tests/SpiffWorkflow/dmn/python_engine/DictDotNotationDecisionWeirdCharactersTest.py
Jon Herron 0892db6fa7 Squashed 'SpiffWorkflow/' content from commit 63db3e4
git-subtree-dir: SpiffWorkflow
git-subtree-split: 63db3e45947ec66b8d0efc2c74064004f8ff482c
2022-10-12 10:19:53 -04:00

37 lines
1.1 KiB
Python

import unittest
from SpiffWorkflow.bpmn.PythonScriptEngine import Box
from .PythonDecisionRunner import PythonDecisionRunner
class DictDotNotationDecisionWeirdCharactersTestClass(unittest.TestCase):
@classmethod
def setUpClass(cls):
dmn_files =[
'dict_dot_notation_decision_weird_characters.dmn',
'dict_dot_notation_decision_weird_characters_v1_3.dmn',
]
cls.runners = [PythonDecisionRunner(d) for d in dmn_files]
def test_string_decision_string_output1(self):
for runner in self.runners:
data = {"odd_foods": {
"SPAM_LIKE": {"delicious": False}
}}
res = runner.decide(Box(data))
self.assertEqual(res.description, 'This person has a tongue, brain '
'or sense of smell.')
data = {"foods": {
"spam": {"delicious": False}
}}
def suite():
return unittest.TestLoader().loadTestsFromTestCase(
DictDotNotationDecisionWeirdCharactersTestClass)
if __name__ == '__main__':
unittest.TextTestRunner(verbosity=2).run(suite())