Skip to content

Commit 0fdd2c3

Browse files
authored
Merge pull request #45 from allenai/favyen/fix-maldives-test
remove gcs dependency in maldives ecosystem mapping workflow test
2 parents 72100cb + b8ce639 commit 0fdd2c3

File tree

5 files changed

+38
-1
lines changed

5 files changed

+38
-1
lines changed
File renamed without changes.
File renamed without changes.

tests/maldives_ecosystem_mapping/data/generate_test_data.py renamed to tests/integration/maldives_ecosystem_mapping/data/generate_test_data.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,41 @@ def create_json(fname):
7575
json.dump(json_data, f)
7676

7777

78+
def create_islands_file(fname):
79+
json_data = {
80+
"type": "FeatureCollection",
81+
"crs": {
82+
"properties": {
83+
"name": "EPSG:3857",
84+
},
85+
},
86+
"features": [
87+
{
88+
"type": "Feature",
89+
"properties": {
90+
"atoll": "x",
91+
"islandName": "x",
92+
"FCODE": "x",
93+
},
94+
"geometry": {
95+
"type": "Polygon",
96+
"coordinates": [
97+
[
98+
[0, 0],
99+
[0, tif_size],
100+
[tif_size, tif_size],
101+
[tif_size, 0],
102+
]
103+
],
104+
},
105+
}
106+
],
107+
}
108+
with open(fname, "w") as f:
109+
json.dump(json_data, f)
110+
111+
78112
if __name__ == "__main__":
79113
create_tif("fake_2024-01-01-00-00.tif")
80114
create_json("fake_2024-01-01-00-00_labels.json")
115+
create_islands_file("islands.json")
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"type": "FeatureCollection", "crs": {"properties": {"name": "EPSG:3857"}}, "features": [{"type": "Feature", "properties": {"atoll": "x", "islandName": "x", "FCODE": "x"}, "geometry": {"type": "Polygon", "coordinates": [[[0, 0], [0, 32], [32, 32], [32, 0]]]}}]}

tests/maldives_ecosystem_mapping/test_workflows.py renamed to tests/integration/maldives_ecosystem_mapping/test_workflows.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
def test_workflows(tmp_path):
1010
dp_config = DataPipelineConfig(
1111
ds_root=str(tmp_path),
12-
src_dir="tests/maldives_ecosystem_mapping/data",
12+
src_dir="tests/integration/maldives_ecosystem_mapping/data",
13+
islands_fname="tests/integration/maldives_ecosystem_mapping/data/islands.json",
1314
)
1415
data_pipeline(dp_config)
1516
assert os.path.exists(

0 commit comments

Comments
 (0)