22
33from clipped .utils .assertions import assert_equal_dict
44
5- from polyaxon ._flow import V1CompiledOperation , V1Plugins , V1RunKind
5+ from polyaxon .schemas import V1CompiledOperation , V1Plugins , V1RunKind
66from polyaxon ._polyaxonfile .specs import kinds
77from polyaxon ._utils .test_utils import BaseTestCase
88
@@ -46,6 +46,11 @@ def test_plugins_config(self):
4646 config = V1Plugins .from_dict (config_dict )
4747 assert_equal_dict (config_dict , config .to_dict ())
4848
49+ # Add sandbox bool
50+ config_dict ["sandbox" ] = True
51+ config = V1Plugins .from_dict (config_dict )
52+ assert_equal_dict (config_dict , config .to_dict ())
53+
4954 # Add notifications
5055 config_dict ["notifications" ] = [
5156 {"connections" : ["test1" ], "trigger" : "succeeded" },
@@ -66,6 +71,17 @@ def test_plugins_tmux_config(self):
6671 assert_equal_dict (config_dict , config .to_dict ())
6772 assert config .tmux is False
6873
74+ def test_plugins_sandbox_config (self ):
75+ config_dict = {"sandbox" : True }
76+ config = V1Plugins .from_dict (config_dict )
77+ assert_equal_dict (config_dict , config .to_dict ())
78+ assert config .sandbox is True
79+
80+ config_dict = {"sandbox" : False }
81+ config = V1Plugins .from_dict (config_dict )
82+ assert_equal_dict (config_dict , config .to_dict ())
83+ assert config .sandbox is False
84+
6985 def test_get_from_spec (self ):
7086 compiled_operation = V1CompiledOperation .read (
7187 {
@@ -79,6 +95,7 @@ def test_get_from_spec(self):
7995 "collectArtifacts" : False ,
8096 "syncStatuses" : False ,
8197 "externalHost" : True ,
98+ "sandbox" : True ,
8299 },
83100 "run" : {"kind" : V1RunKind .JOB , "container" : {"image" : "test" }},
84101 }
@@ -94,6 +111,7 @@ def test_get_from_spec(self):
94111 assert plugins .sync_statuses is False
95112 assert plugins .external_host is True
96113 assert plugins .tmux is False
114+ assert plugins .sandbox is True
97115
98116 def test_read_keys_from_env (self ):
99117 spec = V1Plugins (
@@ -106,6 +124,7 @@ def test_read_keys_from_env(self):
106124 sync_statuses = True ,
107125 external_host = True ,
108126 tmux = True ,
127+ sandbox = True ,
109128 )
110129 spec = V1Plugins .get_or_create (spec )
111130 assert spec .auth is True
@@ -117,6 +136,7 @@ def test_read_keys_from_env(self):
117136 assert spec .sync_statuses is True
118137 assert spec .external_host is True
119138 assert spec .tmux is True
139+ assert spec .sandbox is True
120140
121141 def test_get_from_empty_env (self ):
122142 spec = V1Plugins ()
@@ -130,6 +150,7 @@ def test_get_from_empty_env(self):
130150 assert spec .sync_statuses is True
131151 assert spec .external_host is False
132152 assert spec .tmux is False
153+ assert spec .sandbox is False
133154
134155 spec = V1Plugins ()
135156 spec = V1Plugins .get_or_create (spec )
@@ -142,3 +163,4 @@ def test_get_from_empty_env(self):
142163 assert spec .sync_statuses is True
143164 assert spec .external_host is False
144165 assert spec .tmux is False
166+ assert spec .sandbox is False
0 commit comments