mirror of
https://github.com/sartography/spiff-arena.git
synced 2025-01-18 21:41:04 +00:00
0892db6fa7
git-subtree-dir: SpiffWorkflow git-subtree-split: 63db3e45947ec66b8d0efc2c74064004f8ff482c
37 lines
1.1 KiB
Python
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())
|