File tree 3 files changed +17
-3
lines changed
3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 1
- __version__ = "0.126.0a1 "
1
+ __version__ = "0.126.1a1 "
Original file line number Diff line number Diff line change 4
4
5
5
import requests
6
6
7
- from openeo_driver .errors import OpenEOApiException
7
+ from openeo_driver .errors import OpenEOApiException , ProcessGraphInvalidException
8
8
from openeo_driver .util .http import is_http_url
9
9
10
10
_log = logging .getLogger (__name__ )
@@ -142,6 +142,8 @@ def extract_default_job_options_from_process_graph(
142
142
143
143
job_options = []
144
144
for node in process_graph .values ():
145
+ if not (isinstance (node , dict ) and "process_id" in node and "arguments" in node ):
146
+ raise ProcessGraphInvalidException
145
147
namespace = node .get ("namespace" )
146
148
process_id = node ["process_id" ]
147
149
if is_http_url (namespace ):
Original file line number Diff line number Diff line change 1
- from openeo_driver .errors import OpenEOApiException
1
+ from openeo_driver .errors import OpenEOApiException , ProcessGraphInvalidException
2
2
from openeo_driver .processgraph import (
3
3
get_process_definition_from_url ,
4
4
extract_default_job_options_from_process_graph ,
@@ -99,3 +99,15 @@ def test_extract_default_job_options_from_process_graph(requests_mock):
99
99
assert extract_default_job_options_from_process_graph (pg , processing_mode = "synchronous" ) == {
100
100
"cpu" : "green" ,
101
101
}
102
+
103
+
104
+ @pytest .mark .parametrize (
105
+ "pg" ,
106
+ [
107
+ {"garbage" : "yez" },
108
+ {"almost" : {"procezz_id" : "add" , "arguments" : {"x" : "nope" }}},
109
+ ],
110
+ )
111
+ def test_extract_default_job_options_from_process_graph_garbage (pg ):
112
+ with pytest .raises (ProcessGraphInvalidException ):
113
+ extract_default_job_options_from_process_graph (ProcessGraphFlatDict (pg ))
You can’t perform that action at this time.
0 commit comments