Skip to content

Commit 9875c9a

Browse files
authored
Merge pull request #191 from cloudblue/bugfix/LITE-29452-dictionary-changed-error
LITE-29452 Fix dictonary change error
2 parents 75ada00 + 0c2c65b commit 9875c9a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

connect/eaas/runner/managers/interactive.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# Copyright (c) 2022 Ingram Micro. All Rights Reserved.
55
#
66
import asyncio
7+
import copy
78
import logging
89
import time
910
import traceback
@@ -30,7 +31,7 @@ def get_method_name(self, task_data, argument):
3031
return self.handler.events[task_data.input.event_type]['method']
3132

3233
async def get_argument(self, task_data):
33-
return task_data.input.data
34+
return copy.deepcopy(task_data.input.data)
3435

3536
async def build_response(self, task_data, future):
3637
"""

tests/managers/test_interactive.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,11 @@ async def test_get_argument(task_payload, event_type):
303303
config = ConfigHelper()
304304
manager = InteractiveTasksManager(config, None, None)
305305

306-
assert await manager.get_argument(task) == task.input.data
306+
argument = await manager.get_argument(task)
307+
assert argument == task.input.data
308+
309+
argument['additional'] = 'value'
310+
assert task.input.data == {'some': 'data'}
307311

308312

309313
@pytest.mark.asyncio

0 commit comments

Comments
 (0)