|
12 | 12 | JobTask,
|
13 | 13 | Tools,
|
14 | 14 | Catalog,
|
| 15 | + Estimation, |
15 | 16 | )
|
16 | 17 |
|
17 | 18 |
|
|
36 | 37 |
|
37 | 38 |
|
38 | 39 | JSON_WORKFLOW_TASKS = {
|
| 40 | + "error": "None", |
39 | 41 | "data": [
|
40 | 42 | {
|
41 |
| - "id": "c0d04ec3-98d7-4183-902f-5bcb2a176d89", |
| 43 | + "id": "aa2cba17-d35c-4395-ab01-a0fd8191a4b3", |
42 | 44 | "name": "sobloo-s2-l1c-aoiclipped:1",
|
43 |
| - "blockVersionTag": "2.2.2", |
| 45 | + "parentsIds": [], |
| 46 | + "blockName": "sobloo-s2-l1c-aoiclipped", |
| 47 | + "blockVersionTag": "2.3.0", |
44 | 48 | "block": {
|
| 49 | + "id": "3a381e6b-acb7-4cec-ae65-50798ce80e64", |
45 | 50 | "name": "sobloo-s2-l1c-aoiclipped",
|
| 51 | + "displayName": "Sentinel-2 L1C MSI AOI clipped", |
46 | 52 | "parameters": {
|
47 |
| - "nodata": { |
48 |
| - "type": "number", |
49 |
| - }, |
| 53 | + "ids": {"type": "array", "default": "None"}, |
| 54 | + "bbox": {"type": "array", "default": "None"}, |
50 | 55 | "time": {
|
51 | 56 | "type": "dateRange",
|
52 | 57 | "default": "2018-01-01T00:00:00+00:00/2020-12-31T23:59:59+00:00",
|
53 | 58 | },
|
54 | 59 | },
|
| 60 | + "type": "DATA", |
| 61 | + "isDryRunSupported": True, |
| 62 | + "version": "2.3.0", |
55 | 63 | },
|
| 64 | + "environment": "None", |
56 | 65 | },
|
57 | 66 | {
|
58 |
| - "id": "af626c54-156e-4f13-a743-55efd27de533", |
| 67 | + "id": "24375b2a-288b-46c8-b404-53e48d4e7b25", |
59 | 68 | "name": "tiling:1",
|
60 |
| - "blockVersionTag": "1.0.0", |
| 69 | + "parentsIds": ["aa2cba17-d35c-4395-ab01-a0fd8191a4b3"], |
| 70 | + "blockName": "tiling", |
| 71 | + "blockVersionTag": "2.2.3", |
61 | 72 | "block": {
|
| 73 | + "id": "3e146dd6-2b67-4d6e-a422-bb3d973e32ff", |
62 | 74 | "name": "tiling",
|
| 75 | + "displayName": "Raster Tiling", |
63 | 76 | "parameters": {
|
64 | 77 | "nodata": {
|
65 | 78 | "type": "number",
|
66 |
| - "default": None, |
| 79 | + "default": "None", |
67 | 80 | "required": False,
|
68 |
| - "description": "Value representing..", |
| 81 | + "description": "Value representing ...", |
69 | 82 | },
|
70 | 83 | "tile_width": {
|
71 | 84 | "type": "number",
|
|
74 | 87 | "description": "Width of a tile in pixels",
|
75 | 88 | },
|
76 | 89 | },
|
| 90 | + "type": "PROCESSING", |
| 91 | + "isDryRunSupported": False, |
| 92 | + "version": "2.2.3", |
77 | 93 | },
|
| 94 | + "environment": "None", |
78 | 95 | },
|
79 | 96 | ],
|
80 |
| - "error": {}, |
81 | 97 | }
|
82 | 98 |
|
83 | 99 | JSON_BLOCKS = {
|
|
101 | 117 | "error": {},
|
102 | 118 | }
|
103 | 119 |
|
| 120 | +JSON_WORKFLOW_ESTIMATION = { |
| 121 | + "data": { |
| 122 | + "sobloo-s2-l1c-aoiclipped:1": { |
| 123 | + "blockConsumption": { |
| 124 | + "resources": {"unit": "MEGABYTE", "min": 3.145728, "max": 3.145728}, |
| 125 | + "credit": {"min": 0, "max": 0}, |
| 126 | + }, |
| 127 | + "machineConsumption": { |
| 128 | + "duration": {"min": 4041, "max": 26380}, |
| 129 | + "credit": {"min": 3, "max": 3}, |
| 130 | + }, |
| 131 | + }, |
| 132 | + "tiling:1": { |
| 133 | + "blockConsumption": { |
| 134 | + "resources": {"unit": "MEGABYTE", "min": 3.145728, "max": 3.145728}, |
| 135 | + "credit": {"min": 0, "max": 0}, |
| 136 | + }, |
| 137 | + "machineConsumption": { |
| 138 | + "duration": {"min": 80930, "max": 428927}, |
| 139 | + "credit": {"min": 2, "max": 9}, |
| 140 | + }, |
| 141 | + }, |
| 142 | + }, |
| 143 | + "error": {}, |
| 144 | +} |
| 145 | + |
104 | 146 |
|
105 | 147 | # TODO: Use patch.dict instead of 2 fictures?
|
106 | 148 | @pytest.fixture()
|
@@ -426,6 +468,63 @@ def jobs_live(auth_live):
|
426 | 468 | return [job_1, job_2]
|
427 | 469 |
|
428 | 470 |
|
| 471 | +@pytest.fixture() |
| 472 | +def estimation_mock(auth_mock): |
| 473 | + input_parameters = { |
| 474 | + "sobloo-s2-l1c-aoiclipped:1": { |
| 475 | + "time": "2018-01-01T00:00:00+00:00/2020-12-31T23:59:59+00:00", |
| 476 | + "limit": 1, |
| 477 | + "bbox": [13.33409, 52.474922, 13.38547, 52.500398], |
| 478 | + }, |
| 479 | + "tiling:1": {"tile_width": 768}, |
| 480 | + } |
| 481 | + |
| 482 | + input_tasks = [ |
| 483 | + { |
| 484 | + "name": "sobloo-s2-l1c-aoiclipped:1", |
| 485 | + "parentName": None, |
| 486 | + "blockId": "3a381e6b-acb7-4cec-ae65-50798ce80e64", |
| 487 | + "blockVersionTag": "2.3.0", |
| 488 | + }, |
| 489 | + { |
| 490 | + "name": "tiling:1", |
| 491 | + "parentName": "sobloo-s2-l1c-aoiclipped:1", |
| 492 | + "blockId": "3e146dd6-2b67-4d6e-a422-bb3d973e32ff", |
| 493 | + "blockVersionTag": "2.2.3", |
| 494 | + }, |
| 495 | + ] |
| 496 | + |
| 497 | + return Estimation(auth_mock, input_parameters, input_tasks) |
| 498 | + |
| 499 | + |
| 500 | +@pytest.fixture() |
| 501 | +def estimation_live(auth_live): |
| 502 | + input_parameters = { |
| 503 | + "sobloo-s2-l1c-aoiclipped:1": { |
| 504 | + "time": "2018-01-01T00:00:00+00:00/2020-12-31T23:59:59+00:00", |
| 505 | + "limit": 1, |
| 506 | + "bbox": [13.33409, 52.474922, 13.38547, 52.500398], |
| 507 | + }, |
| 508 | + "tiling:1": {"tile_width": 768}, |
| 509 | + } |
| 510 | + |
| 511 | + input_tasks = [ |
| 512 | + { |
| 513 | + "name": "sobloo-s2-l1c-aoiclipped:1", |
| 514 | + "parentName": None, |
| 515 | + "blockId": "3a381e6b-acb7-4cec-ae65-50798ce80e64", |
| 516 | + "blockVersionTag": "2.3.0", |
| 517 | + }, |
| 518 | + { |
| 519 | + "name": "tiling:1", |
| 520 | + "parentName": "sobloo-s2-l1c-aoiclipped:1", |
| 521 | + "blockId": "3e146dd6-2b67-4d6e-a422-bb3d973e32ff", |
| 522 | + "blockVersionTag": "2.2.3", |
| 523 | + }, |
| 524 | + ] |
| 525 | + return Estimation(auth_live, input_parameters, input_tasks) |
| 526 | + |
| 527 | + |
429 | 528 | @pytest.fixture()
|
430 | 529 | def jobcollection_single_mock(auth_mock, job_mock):
|
431 | 530 | return JobCollection(
|
|
0 commit comments