Skip to content

Commit

Permalink
test another one of Victor's process graphs #424
Browse files Browse the repository at this point in the history
  • Loading branch information
bossie committed Jul 17, 2024
1 parent cebeb82 commit 7ffc968
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions tests/test_batch_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -980,8 +980,18 @@ def test_multiple_top_level_side_effects(tmp_path, caplog):
assert dataset.count == 2


def test_multiple_save_results(tmp_path):
with open(get_test_data_file("multiple_save_results/pg01.json")) as f:
@pytest.mark.parametrize(["process_graph_file", "output_file_predicates"], [
("pg01.json", {
"intermediate.tif": lambda dataset: dataset.res == (10, 10),
"final.tif": lambda dataset: dataset.res == (80, 80)
}),
("pg02.json", {
"B04.tif": lambda dataset: dataset.tags(1)["DESCRIPTION"] == "B04",
"B11.tif": lambda dataset: dataset.tags(1)["DESCRIPTION"] == "B11",
}),
])
def test_multiple_save_results(tmp_path, process_graph_file, output_file_predicates):
with open(get_test_data_file(f"multiple_save_results/{process_graph_file}")) as f:
process = json.load(f)

run_job(
Expand All @@ -993,8 +1003,6 @@ def test_multiple_save_results(tmp_path):
dependencies=[],
)

with rasterio.open(tmp_path / "intermediate.tif") as dataset:
assert dataset.res == (10, 10)

with rasterio.open(tmp_path / "final.tif") as dataset:
assert dataset.res == (80, 80)
for output_file, predicate in output_file_predicates.items():
with rasterio.open(tmp_path / output_file) as dataset:
assert predicate(dataset)

0 comments on commit 7ffc968

Please sign in to comment.