mirror of
https://github.com/sartography/spiff-arena.git
synced 2025-03-01 09:30:46 +00:00
git-subtree-dir: SpiffWorkflow git-subtree-split: 63db3e45947ec66b8d0efc2c74064004f8ff482c
40 lines
1.2 KiB
Python
40 lines
1.2 KiB
Python
import unittest
|
|
|
|
from SpiffWorkflow.bpmn.PythonScriptEngine import Box
|
|
|
|
from .FeelDecisionRunner import FeelDecisionRunner
|
|
|
|
|
|
class FeelDictDotNotationDecisionTestClass(unittest.TestCase):
|
|
|
|
@classmethod
|
|
def setUpClass(cls):
|
|
cls.runner = FeelDecisionRunner('dict_dot_notation_decision_feel.dmn')
|
|
|
|
def test_string_decision_string_output1(self):
|
|
data = {"foods": {
|
|
"spam": {"delicious": False}
|
|
}}
|
|
res = self.runner.decide(Box(data))
|
|
self.assertEqual(res.description, 'This person has a tongue, brain '
|
|
'or sense of smell.')
|
|
|
|
data = {"foods": {
|
|
"spam": {"delicious": False}
|
|
}}
|
|
def test_string_decision_string_output2(self):
|
|
data = {"foods": {
|
|
"spam": {"delicious": True}
|
|
}}
|
|
res = self.runner.decide(Box(data))
|
|
self.assertEqual(res.description, 'This person is lacking many '
|
|
'critical decision making skills, '
|
|
'or is a viking.')
|
|
|
|
|
|
def suite():
|
|
return unittest.TestLoader().loadTestsFromTestCase(FeelDictDotNotationDecisionTestClass)
|
|
|
|
if __name__ == '__main__':
|
|
unittest.TextTestRunner(verbosity=2).run(suite())
|