def test_opt_in_dict_auto_convert(self):
        """Test ability for user to opt-in to dict convert functionality"""

        runner = RunnerType()
        runner.runner_parameters = {}

        action = Action()
        action.ref = "test.action"
        action.parameters = {
            "param_array": {"type": "array"},
        }

        subparser = mock.Mock()
        command = ActionRunCommand(action, self, subparser, name="test")

        mockarg = mock.Mock()
        mockarg.inherit_env = False
        mockarg.parameters = [
            "param_array=foo:bar,foo2:bar2",
        ]

        mockarg.auto_dict = False
        param = command._get_action_parameters_from_args(
            action=action, runner=runner, args=mockarg
        )
        self.assertEqual(param["param_array"], ["foo:bar", "foo2:bar2"])

        mockarg.auto_dict = True
        param = command._get_action_parameters_from_args(
            action=action, runner=runner, args=mockarg
        )
        self.assertEqual(param["param_array"], [{"foo": "bar", "foo2": "bar2"}])

        # set auto_dict back to default
        mockarg.auto_dict = False
Test ability for user to opt-in to dict convert functionality
st2client/tests/unit/test_command_actionrun.py