File tree Expand file tree Collapse file tree 3 files changed +16
-20
lines changed
stacklet/client/sinistral/commands Expand file tree Collapse file tree 3 files changed +16
-20
lines changed Original file line number Diff line number Diff line change 21942194 "added" : 0 ,
21952195 "updated" : 0 ,
21962196 "removed" : 0 ,
2197- "started_at" : " 2023-09-19T20:57:16.486859 "
2197+ "started_at" : " 2023-10-06T20:10:54.534411 "
21982198 }
21992199 }
22002200 }
23202320 "added" : 0 ,
23212321 "updated" : 0 ,
23222322 "removed" : 0 ,
2323- "started_at" : " 2023-09-19T20:57:16.486380 "
2323+ "started_at" : " 2023-10-06T20:10:54.533561 "
23242324 }
23252325 }
23262326 }
27152715 },
27162716 {
27172717 "type" : " array" ,
2718- "items" : {}
2718+ "items" : {
2719+ "type" : " string"
2720+ }
27192721 }
27202722 ]
27212723 },
28322834 },
28332835 "Severity" : {
28342836 "title" : " Severity" ,
2835- "enum" : [
2836- " HIGH" ,
2837- " MEDIUM" ,
2838- " LOW" ,
2839- " UNKNOWN"
2840- ],
28412837 "type" : " string" ,
2842- "description" : " An enumeration."
2838+ "description" : " Severity of a policy violation." ,
2839+ "pattern" : " (?i)^(high|medium|low|unknown)$"
28432840 },
28442841 "Summary" : {
28452842 "title" : " Summary" ,
Original file line number Diff line number Diff line change @@ -90,7 +90,10 @@ class Create(ClientCommand):
9090 "title" : "Resource" ,
9191 "anyOf" : [
9292 {"type" : "string" },
93- {"type" : "array" , "items" : {}},
93+ {
94+ "type" : "array" ,
95+ "items" : {"type" : "string" },
96+ },
9497 ],
9598 },
9699 "description" : {
@@ -103,14 +106,9 @@ class Create(ClientCommand):
103106 "properties" : {
104107 "severity" : {
105108 "title" : "Severity" ,
106- "enum" : [
107- "HIGH" ,
108- "MEDIUM" ,
109- "LOW" ,
110- "UNKNOWN" ,
111- ],
112109 "type" : "string" ,
113- "description" : "An enumeration." ,
110+ "description" : "Severity of a policy violation." ,
111+ "pattern" : "(?i)^(high|medium|low|unknown)$" ,
114112 }
115113 },
116114 },
Original file line number Diff line number Diff line change @@ -316,7 +316,8 @@ def test_client_command_uses_query_params():
316316 assert res == {"a" : "policy" }
317317
318318
319- def test_client_command_scan_create ():
319+ @pytest .mark .parametrize ("severity" , ["HIGH" , "high" ])
320+ def test_client_command_scan_create (severity ):
320321 client = sinistral_client ().client ("scans" )
321322 with patch .object (
322323 RestExecutor , "post" , return_value = get_mock_response (json = {"id" : "new-scan" })
@@ -332,7 +333,7 @@ def test_client_command_scan_create():
332333 "description" : "foo" ,
333334 "filters" : [],
334335 "mode" : {},
335- "metadata" : {"severity" : "HIGH " },
336+ "metadata" : {"severity" : f" { severity } " },
336337 },
337338 "resource" : {
338339 "id" : "foo" ,
You can’t perform that action at this time.
0 commit comments