Browse Source

Fix workflow language tests after updating jsonschema to 3.0.2

* The new version of jsonschema (3.0.2) considers numbers written
  as XXX.0 (an integer but written using the form of float numbers)
  integers. Whereas the previous versions didn't. So we have to
  fix the tests that expected an error in this case when validating
  the syntax of the policies.

Change-Id: Ifc36f4a1f6126d6cbde2424fd88967c04d84185a
tags/9.0.0.0b1
Renat Akhmerov 1 month ago
parent
commit
fdfb65a8ff

+ 4
- 4
mistral/tests/unit/lang/v2/test_tasks.py View File

@@ -231,7 +231,7 @@ class TaskSpecValidationTest(v2_base.WorkflowSpecValidationTestCase):
231 231
             ({'wait-before': '{{ 1 }}'}, False),
232 232
             ({'wait-before': '{{ * }}'}, True),
233 233
             ({'wait-before': -1}, True),
234
-            ({'wait-before': 1.0}, True),
234
+            ({'wait-before': 1.1}, True),
235 235
             ({'wait-before': '1'}, True),
236 236
             ({'wait-after': 1}, False),
237 237
             ({'wait-after': '<% 1 %>'}, False),
@@ -239,7 +239,7 @@ class TaskSpecValidationTest(v2_base.WorkflowSpecValidationTestCase):
239 239
             ({'wait-after': '{{ 1 }}'}, False),
240 240
             ({'wait-after': '{{ * }}'}, True),
241 241
             ({'wait-after': -1}, True),
242
-            ({'wait-after': 1.0}, True),
242
+            ({'wait-after': 1.1}, True),
243 243
             ({'wait-after': '1'}, True),
244 244
             ({'timeout': 300}, False),
245 245
             ({'timeout': '<% 300 %>'}, False),
@@ -247,7 +247,7 @@ class TaskSpecValidationTest(v2_base.WorkflowSpecValidationTestCase):
247 247
             ({'timeout': '{{ 300 }}'}, False),
248 248
             ({'timeout': '{{ * }}'}, True),
249 249
             ({'timeout': -300}, True),
250
-            ({'timeout': 300.0}, True),
250
+            ({'timeout': 300.1}, True),
251 251
             ({'timeout': '300'}, True),
252 252
             ({'pause-before': False}, False),
253 253
             ({'pause-before': '<% False %>'}, False),
@@ -261,7 +261,7 @@ class TaskSpecValidationTest(v2_base.WorkflowSpecValidationTestCase):
261 261
             ({'concurrency': '{{ 10 }}'}, False),
262 262
             ({'concurrency': '{{ * }}'}, True),
263 263
             ({'concurrency': -10}, True),
264
-            ({'concurrency': 10.0}, True),
264
+            ({'concurrency': 10.1}, True),
265 265
             ({'concurrency': '10'}, True)
266 266
         ]
267 267
 

+ 4
- 4
mistral/tests/unit/lang/v2/test_workflows.py View File

@@ -352,7 +352,7 @@ class WorkflowSpecValidationTest(base.WorkflowSpecValidationTestCase):
352 352
             ({'wait-before': '{{ 1 }}'}, False),
353 353
             ({'wait-before': '{{ * }}'}, True),
354 354
             ({'wait-before': -1}, True),
355
-            ({'wait-before': 1.0}, True),
355
+            ({'wait-before': 1.1}, True),
356 356
             ({'wait-before': '1'}, True),
357 357
             ({'wait-after': 1}, False),
358 358
             ({'wait-after': '<% 1 %>'}, False),
@@ -360,7 +360,7 @@ class WorkflowSpecValidationTest(base.WorkflowSpecValidationTestCase):
360 360
             ({'wait-after': '{{ 1 }}'}, False),
361 361
             ({'wait-after': '{{ * }}'}, True),
362 362
             ({'wait-after': -1}, True),
363
-            ({'wait-after': 1.0}, True),
363
+            ({'wait-after': 1.1}, True),
364 364
             ({'wait-after': '1'}, True),
365 365
             ({'timeout': 300}, False),
366 366
             ({'timeout': '<% 300 %>'}, False),
@@ -368,7 +368,7 @@ class WorkflowSpecValidationTest(base.WorkflowSpecValidationTestCase):
368 368
             ({'timeout': '{{ 300 }}'}, False),
369 369
             ({'timeout': '{{ * }}'}, True),
370 370
             ({'timeout': -300}, True),
371
-            ({'timeout': 300.0}, True),
371
+            ({'timeout': 300.1}, True),
372 372
             ({'timeout': '300'}, True),
373 373
             ({'pause-before': False}, False),
374 374
             ({'pause-before': '<% False %>'}, False),
@@ -382,7 +382,7 @@ class WorkflowSpecValidationTest(base.WorkflowSpecValidationTestCase):
382 382
             ({'concurrency': '{{ 10 }}'}, False),
383 383
             ({'concurrency': '{{ * }}'}, True),
384 384
             ({'concurrency': -10}, True),
385
-            ({'concurrency': 10.0}, True),
385
+            ({'concurrency': 10.1}, True),
386 386
             ({'concurrency': '10'}, True),
387 387
             ({'safe-rerun': True}, False),
388 388
             ({'safe-rerun': False}, False),

Loading…
Cancel
Save