File size: 807 Bytes
1721aea
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import unittest
from auto_causal.components.state_manager import create_workflow_state_update

class TestStateManagerUtils(unittest.TestCase):

    def test_create_workflow_state_update(self):
        '''Test the workflow state update utility function.'''
        current = "step_A"
        flag = "step_A_done"
        next_tool = "tool_B"
        reason = "Reason for B"

        expected_output = {
            "workflow_state": {
                "current_step": current,
                flag: True,
                "next_tool": next_tool,
                "next_step_reason": reason
            }
        }

        actual_output = create_workflow_state_update(current, flag, next_tool, reason)
        self.assertDictEqual(actual_output, expected_output)

if __name__ == '__main__':
    unittest.main()