Skip to content

Commit 6ec2c0f

Browse files
committed
Added code_execution_config to tests.
1 parent 261d07a commit 6ec2c0f

File tree

1 file changed

+28
-4
lines changed

1 file changed

+28
-4
lines changed

tests/test_kubectl_executor_agent.py

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@
55

66
def test_execute_code_blocks_when_read_only_then_allow_read_execution():
77
"""Allow read commands when read_only=False."""
8-
executor_agent = KubectlExecutorAgent(name="test_kait", read_only=True)
8+
executor_agent = KubectlExecutorAgent(
9+
name="test_kait",
10+
read_only=True,
11+
code_execution_config={
12+
"use_docker": False,
13+
},
14+
)
915

1016
executor_agent.run_code = MagicMock(return_value=(0, "", ""))
1117

@@ -17,7 +23,13 @@ def test_execute_code_blocks_when_read_only_then_allow_read_execution():
1723

1824
def test_execute_code_blocks_when_read_only_then_prevent_create_execution():
1925
"""Prevent CUD commands when read_only=True."""
20-
executor_agent = KubectlExecutorAgent(name="test_kait", read_only=True)
26+
executor_agent = KubectlExecutorAgent(
27+
name="test_kait",
28+
read_only=True,
29+
code_execution_config={
30+
"use_docker": False,
31+
},
32+
)
2133

2234
code_blocks = [("bash", "kubectl create deployment nginx --image nginx")]
2335

@@ -27,7 +39,13 @@ def test_execute_code_blocks_when_read_only_then_prevent_create_execution():
2739

2840
def test_execute_code_blocks_when_not_read_only_then_allow_create_execution():
2941
"""Allow CRUD commands when read_only=False."""
30-
executor_agent = KubectlExecutorAgent(name="test_kait", read_only=False)
42+
executor_agent = KubectlExecutorAgent(
43+
name="test_kait",
44+
read_only=False,
45+
code_execution_config={
46+
"use_docker": False,
47+
},
48+
)
3149

3250
executor_agent.run_code = MagicMock(return_value=(0, "", ""))
3351

@@ -39,7 +57,13 @@ def test_execute_code_blocks_when_not_read_only_then_allow_create_execution():
3957

4058
def test_execute_code_blocks_when_blocking_command_used_then_prevent_execution():
4159
"""Prevent commands that block execution."""
42-
executor_agent = KubectlExecutorAgent(name="test_kait", read_only=False)
60+
executor_agent = KubectlExecutorAgent(
61+
name="test_kait",
62+
read_only=False,
63+
code_execution_config={
64+
"use_docker": False,
65+
},
66+
)
4367

4468
executor_agent.run_code = MagicMock(return_value=(0, "", ""))
4569

0 commit comments

Comments
 (0)