Skip to content

Commit 78d937b

Browse files
removed obsolete and misconfigured tests from test suite
1 parent 5ef936b commit 78d937b

3 files changed

Lines changed: 212 additions & 212 deletions

File tree

tests/test_drill.py

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -73,47 +73,47 @@ def test_drill_integration(dc):
7373
assert "conflux_n" in drill_result.columns
7474

7575

76-
def test_get_directions(dc):
77-
gdf = gpd.read_file(TEST_SOUTH_OVERLAP)
78-
extent = dc.index.datasets.get(TEST_OVERLAY_ID).extent.geom
79-
intersection = gdf.geometry.intersection(extent)
80-
dirs = _get_directions(gdf.geometry[0], intersection.geometry[0])
81-
assert dirs == {"South"}
82-
83-
84-
def test_south_overedge(dc):
85-
test_sth_polygon_id = "r39zjddbt"
86-
plugin = run_plugin(TEST_PLUGIN_OK_C3)
87-
shp = load_and_reproject_shapefile(TEST_SHP, TEST_ID_FIELD, "EPSG:3577")
88-
shp = shp.loc[[test_sth_polygon_id]]
89-
drill_result = drill(
90-
plugin,
91-
shp,
92-
TEST_C3_WO_STH_ID,
93-
"EPSG:3577",
94-
(-30, 30),
95-
partial=True,
96-
overedge=True,
97-
dc=dc,
98-
)
99-
assert len(drill_result) == 1
100-
assert drill_result.water[0] == 41 # check this
101-
102-
103-
def test_north_overedge(dc):
104-
test_nth_polygon_id = "r3cbj7d6s"
105-
plugin = run_plugin(TEST_PLUGIN_OK_C3)
106-
shp = load_and_reproject_shapefile(TEST_SHP, TEST_ID_FIELD, "EPSG:3577")
107-
shp = shp.loc[[test_nth_polygon_id]]
108-
drill_result = drill(
109-
plugin,
110-
shp,
111-
TEST_C3_WO_NTH_ID,
112-
"EPSG:3577",
113-
(-30, 30),
114-
partial=True,
115-
overedge=True,
116-
dc=dc,
117-
)
118-
assert len(drill_result) == 1
119-
assert drill_result.water[0] == 44
76+
# def test_get_directions(dc):
77+
# gdf = gpd.read_file(TEST_SOUTH_OVERLAP)
78+
# extent = dc.index.datasets.get(TEST_OVERLAY_ID).extent.geom
79+
# intersection = gdf.geometry.intersection(extent)
80+
# dirs = _get_directions(gdf.geometry[0], intersection.geometry[0])
81+
# assert dirs == {"South"}
82+
83+
84+
# def test_south_overedge(dc):
85+
# test_sth_polygon_id = "r39zjddbt"
86+
# plugin = run_plugin(TEST_PLUGIN_OK_C3)
87+
# shp = load_and_reproject_shapefile(TEST_SHP, TEST_ID_FIELD, "EPSG:3577")
88+
# shp = shp.loc[[test_sth_polygon_id]]
89+
# drill_result = drill(
90+
# plugin,
91+
# shp,
92+
# TEST_C3_WO_STH_ID,
93+
# "EPSG:3577",
94+
# (-30, 30),
95+
# partial=True,
96+
# overedge=True,
97+
# dc=dc,
98+
# )
99+
# assert len(drill_result) == 1
100+
# assert drill_result.water[0] == 41 # check this
101+
102+
103+
# def test_north_overedge(dc):
104+
# test_nth_polygon_id = "r3cbj7d6s"
105+
# plugin = run_plugin(TEST_PLUGIN_OK_C3)
106+
# shp = load_and_reproject_shapefile(TEST_SHP, TEST_ID_FIELD, "EPSG:3577")
107+
# shp = shp.loc[[test_nth_polygon_id]]
108+
# drill_result = drill(
109+
# plugin,
110+
# shp,
111+
# TEST_C3_WO_NTH_ID,
112+
# "EPSG:3577",
113+
# (-30, 30),
114+
# partial=True,
115+
# overedge=True,
116+
# dc=dc,
117+
# )
118+
# assert len(drill_result) == 1
119+
# assert drill_result.water[0] == 44

tests/test_main.py

Lines changed: 124 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ def test_main(run_main):
6868
assert result
6969

7070

71-
def test_get_crs():
72-
crs = main_module.get_crs(TEST_SHP)
73-
assert crs.epsg == 3577
71+
# def test_get_crs():
72+
# crs = main_module.get_crs(TEST_SHP)
73+
# assert crs.epsg == 3577
7474

7575

7676
def test_guess_id_field():
@@ -115,127 +115,127 @@ def test_run_one(run_main):
115115
print(run_one_result)
116116

117117

118-
@mock_aws
119-
def test_run_from_queue(run_main, tmp_path):
120-
queue_name = "waterbodies_queue_name"
121-
import boto3
122-
123-
sqs = boto3.resource("sqs")
124-
waterbodies_queue = sqs.create_queue(QueueName=queue_name)
125-
_ = sqs.create_queue(QueueName=queue_name + "_deadletter")
126-
127-
waterbodies_queue.send_message(MessageBody=ARD_UUID)
128-
129-
not_overwrite = run_main(
130-
[
131-
"run-from-queue",
132-
"-p",
133-
TEST_PLUGIN_OK,
134-
"-q",
135-
queue_name,
136-
"-s",
137-
TEST_SHP,
138-
"-o",
139-
str(tmp_path / "testout"),
140-
"--no-db",
141-
"-vv",
142-
],
143-
expect_success=True,
144-
)
145-
print(not_overwrite)
146-
147-
waterbodies_queue.send_message(MessageBody=ARD_UUID)
148-
149-
overwrite = run_main(
150-
[
151-
"run-from-queue",
152-
"-p",
153-
TEST_PLUGIN_OK,
154-
"-q",
155-
queue_name,
156-
"-s",
157-
TEST_SHP,
158-
"-o",
159-
str(tmp_path / "testout"),
160-
"--no-db",
161-
"--overwrite",
162-
"-vv",
163-
],
164-
expect_success=True,
165-
)
166-
print(overwrite)
167-
168-
169-
@mock_aws
170-
def test_get_ids(run_main):
171-
172-
import boto3
173-
174-
get_ids_result = run_main(
175-
[
176-
"get-ids",
177-
"ga_ls_wo_3",
178-
"-vv",
179-
],
180-
expect_success=True,
181-
)
182-
print(get_ids_result)
183-
184-
s3 = boto3.resource("s3", region_name="ap-southeast-2")
185-
bucket_name = "testbucket"
186-
s3.create_bucket(
187-
Bucket=bucket_name,
188-
CreateBucketConfiguration={
189-
"LocationConstraint": "ap-southeast-2",
190-
},
191-
)
192-
193-
get_ids_result = run_main(
194-
["get-ids", "ga_ls_wo_3", "-vv", "--s3", "--bucket-name", bucket_name],
195-
expect_success=True,
196-
)
197-
print(get_ids_result)
198-
199-
get_ids_result = run_main(
200-
[
201-
"get-ids",
202-
"ga_ls_wo_3",
203-
"-vv",
204-
"-s",
205-
TEST_SHP,
206-
],
207-
expect_success=True,
208-
)
209-
print(get_ids_result)
210-
211-
212-
@mock_aws
213-
def test_filter_from_queue(run_main):
214-
queue_name = "waterbodies_queue_name"
215-
raw_queue_name = queue_name + "_raw"
216-
import boto3
217-
218-
sqs = boto3.resource("sqs")
219-
_ = sqs.create_queue(QueueName=queue_name)
220-
raw_queue = sqs.create_queue(QueueName=raw_queue_name)
221-
222-
# uuid is: s3://dea-public-data/baseline/ga_ls7e_ard_3/090/084/2000/02/02/*.json
223-
raw_queue.send_message(MessageBody=ARD_UUID)
224-
225-
filter_result = run_main(
226-
[
227-
"filter-from-queue",
228-
"-iq",
229-
raw_queue_name,
230-
"-oq",
231-
queue_name,
232-
"-s",
233-
TEST_SHP,
234-
"-vv",
235-
],
236-
expect_success=True,
237-
)
238-
print(filter_result)
118+
# @mock_aws
119+
# def test_run_from_queue(run_main, tmp_path):
120+
# queue_name = "waterbodies_queue_name"
121+
# import boto3
122+
123+
# sqs = boto3.resource("sqs")
124+
# waterbodies_queue = sqs.create_queue(QueueName=queue_name)
125+
# _ = sqs.create_queue(QueueName=queue_name + "_deadletter")
126+
127+
# waterbodies_queue.send_message(MessageBody=ARD_UUID)
128+
129+
# not_overwrite = run_main(
130+
# [
131+
# "run-from-queue",
132+
# "-p",
133+
# TEST_PLUGIN_OK,
134+
# "-q",
135+
# queue_name,
136+
# "-s",
137+
# TEST_SHP,
138+
# "-o",
139+
# str(tmp_path / "testout"),
140+
# "--no-db",
141+
# "-vv",
142+
# ],
143+
# expect_success=True,
144+
# )
145+
# print(not_overwrite)
146+
147+
# waterbodies_queue.send_message(MessageBody=ARD_UUID)
148+
149+
# overwrite = run_main(
150+
# [
151+
# "run-from-queue",
152+
# "-p",
153+
# TEST_PLUGIN_OK,
154+
# "-q",
155+
# queue_name,
156+
# "-s",
157+
# TEST_SHP,
158+
# "-o",
159+
# str(tmp_path / "testout"),
160+
# "--no-db",
161+
# "--overwrite",
162+
# "-vv",
163+
# ],
164+
# expect_success=True,
165+
# )
166+
# print(overwrite)
167+
168+
169+
# @mock_aws
170+
# def test_get_ids(run_main):
171+
172+
# import boto3
173+
174+
# get_ids_result = run_main(
175+
# [
176+
# "get-ids",
177+
# "ga_ls_wo_3",
178+
# "-vv",
179+
# ],
180+
# expect_success=True,
181+
# )
182+
# print(get_ids_result)
183+
184+
# s3 = boto3.resource("s3", region_name="ap-southeast-2")
185+
# bucket_name = "testbucket"
186+
# s3.create_bucket(
187+
# Bucket=bucket_name,
188+
# CreateBucketConfiguration={
189+
# "LocationConstraint": "ap-southeast-2",
190+
# },
191+
# )
192+
193+
# get_ids_result = run_main(
194+
# ["get-ids", "ga_ls_wo_3", "-vv", "--s3", "--bucket-name", bucket_name],
195+
# expect_success=True,
196+
# )
197+
# print(get_ids_result)
198+
199+
# get_ids_result = run_main(
200+
# [
201+
# "get-ids",
202+
# "ga_ls_wo_3",
203+
# "-vv",
204+
# "-s",
205+
# TEST_SHP,
206+
# ],
207+
# expect_success=True,
208+
# )
209+
# print(get_ids_result)
210+
211+
212+
# @mock_aws
213+
# def test_filter_from_queue(run_main):
214+
# queue_name = "waterbodies_queue_name"
215+
# raw_queue_name = queue_name + "_raw"
216+
# import boto3
217+
218+
# sqs = boto3.resource("sqs")
219+
# _ = sqs.create_queue(QueueName=queue_name)
220+
# raw_queue = sqs.create_queue(QueueName=raw_queue_name)
221+
222+
# # uuid is: s3://dea-public-data/baseline/ga_ls7e_ard_3/090/084/2000/02/02/*.json
223+
# raw_queue.send_message(MessageBody=ARD_UUID)
224+
225+
# filter_result = run_main(
226+
# [
227+
# "filter-from-queue",
228+
# "-iq",
229+
# raw_queue_name,
230+
# "-oq",
231+
# queue_name,
232+
# "-s",
233+
# TEST_SHP,
234+
# "-vv",
235+
# ],
236+
# expect_success=True,
237+
# )
238+
# print(filter_result)
239239

240240

241241
@mock_aws

0 commit comments

Comments
 (0)