Skip to content

Commit

Permalink
fixup! Issue #95 split POC script from reusable logic
Browse files Browse the repository at this point in the history
  • Loading branch information
soxofaan committed Mar 20, 2023
1 parent 79e0d6e commit 2a58fa5
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions tests/partitionedjobs/test_crossbackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ def test_simple(self):
splitter = CrossBackendSplitter(backend_for_collection=lambda cid: "foo")
res = splitter.split({"process_graph": process_graph})

assert res.subjobs == {"primary": SubJob(process_graph, backend_id=None)}
assert res.dependencies == {"primary": []}
assert res.subjobs == {"main": SubJob(process_graph, backend_id=None)}
assert res.dependencies == {"main": []}

def test_basic(self):
process_graph = {
Expand All @@ -28,7 +28,8 @@ def test_basic(self):
},
"sr1": {
"process_id": "save_result",
"arguments": {"format": "NetCDF"},
"arguments": {"data": {"from_node": "mc1"}, "format": "NetCDF"},
"result": True,
},
}
splitter = CrossBackendSplitter(
Expand All @@ -37,15 +38,15 @@ def test_basic(self):
res = splitter.split({"process_graph": process_graph})

assert res.subjobs == {
"primary": SubJob(
"main": SubJob(
process_graph={
"lc1": {
"process_id": "load_collection",
"arguments": {"id": "B1_NDVI"},
},
"lc2": {
"process_id": "load_result",
"arguments": {"id": "placeholder:B2:lc2"},
"arguments": {"id": "_placeholder:B2:lc2"},
},
"mc1": {
"process_id": "merge_cubes",
Expand All @@ -56,7 +57,8 @@ def test_basic(self):
},
"sr1": {
"process_id": "save_result",
"arguments": {"format": "NetCDF"},
"arguments": {"data": {"from_node": "mc1"}, "format": "NetCDF"},
"result": True,
},
},
backend_id="B1",
Expand All @@ -69,10 +71,11 @@ def test_basic(self):
},
"sr1": {
"process_id": "save_result",
"arguments": {"format": "NetCDF"},
"arguments": {"data": {"from_node": "lc2"}, "format": "GTiff"},
"result": True,
},
},
backend_id="B2",
),
}
assert res.dependencies == {"primary": ["B2:lc2"]}
assert res.dependencies == {"main": ["B2:lc2"]}

0 comments on commit 2a58fa5

Please sign in to comment.