5
5
6
6
def test_execute_code_blocks_when_read_only_then_allow_read_execution ():
7
7
"""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
+ )
9
15
10
16
executor_agent .run_code = MagicMock (return_value = (0 , "" , "" ))
11
17
@@ -17,7 +23,13 @@ def test_execute_code_blocks_when_read_only_then_allow_read_execution():
17
23
18
24
def test_execute_code_blocks_when_read_only_then_prevent_create_execution ():
19
25
"""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
+ )
21
33
22
34
code_blocks = [("bash" , "kubectl create deployment nginx --image nginx" )]
23
35
@@ -27,7 +39,13 @@ def test_execute_code_blocks_when_read_only_then_prevent_create_execution():
27
39
28
40
def test_execute_code_blocks_when_not_read_only_then_allow_create_execution ():
29
41
"""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
+ )
31
49
32
50
executor_agent .run_code = MagicMock (return_value = (0 , "" , "" ))
33
51
@@ -39,7 +57,13 @@ def test_execute_code_blocks_when_not_read_only_then_allow_create_execution():
39
57
40
58
def test_execute_code_blocks_when_blocking_command_used_then_prevent_execution ():
41
59
"""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
+ )
43
67
44
68
executor_agent .run_code = MagicMock (return_value = (0 , "" , "" ))
45
69
0 commit comments