|
5 | 5 |
|
6 | 6 | from pystac import Asset, Collection, Extent, Item, SpatialExtent, TemporalExtent, CatalogType
|
7 | 7 | import pytest
|
8 |
| -from pystac.layout import CustomLayoutStrategy |
9 | 8 |
|
10 | 9 | from openeo_driver.workspace import DiskWorkspace
|
11 | 10 |
|
@@ -58,12 +57,12 @@ def test_merge_from_disk_new(tmp_path):
|
58 | 57 | target = Path("path") / "to" / "collection.json"
|
59 | 58 |
|
60 | 59 | workspace = DiskWorkspace(root_directory=tmp_path)
|
61 |
| - merged_collection = workspace.merge(stac_resource=new_collection, target=target) |
| 60 | + imported_collection = workspace.merge(stac_resource=new_collection, target=target) |
62 | 61 |
|
63 |
| - assert isinstance(merged_collection, Collection) |
| 62 | + assert isinstance(imported_collection, Collection) |
64 | 63 | asset_workspace_uris = {
|
65 | 64 | asset_key: asset.extra_fields["alternate"]["file"]
|
66 |
| - for item in merged_collection.get_items() |
| 65 | + for item in imported_collection.get_items() |
67 | 66 | for asset_key, asset in item.get_assets().items()
|
68 | 67 | }
|
69 | 68 | assert asset_workspace_uris == {
|
@@ -106,16 +105,15 @@ def test_merge_from_disk_into_existing(tmp_path):
|
106 | 105 |
|
107 | 106 | workspace = DiskWorkspace(root_directory=tmp_path)
|
108 | 107 | workspace.merge(stac_resource=existing_collection, target=target)
|
109 |
| - merged_collection = workspace.merge(stac_resource=new_collection, target=target) |
| 108 | + imported_collection = workspace.merge(stac_resource=new_collection, target=target) |
110 | 109 |
|
111 |
| - assert isinstance(merged_collection, Collection) |
| 110 | + assert isinstance(imported_collection, Collection) |
112 | 111 | asset_workspace_uris = {
|
113 | 112 | asset_key: asset.extra_fields["alternate"]["file"]
|
114 |
| - for item in merged_collection.get_items() |
| 113 | + for item in imported_collection.get_items() |
115 | 114 | for asset_key, asset in item.get_assets().items()
|
116 | 115 | }
|
117 | 116 | assert asset_workspace_uris == {
|
118 |
| - "asset1.tif": f"file:{workspace.root_directory / 'path' / 'to' / 'collection.json_items' / 'asset1.tif'}", |
119 | 117 | "asset2.tif": f"file:{workspace.root_directory / 'path' / 'to' / 'collection.json_items' / 'asset2.tif'}",
|
120 | 118 | }
|
121 | 119 |
|
|
0 commit comments