Skip to content

Commit 3c2802f

Browse files
committed
weights error test
1 parent c9bcf73 commit 3c2802f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

cf/test/test_weights.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,16 @@ def test_weights_cell_measures_coordinates(self):
326326
with self.assertRaises(ValueError):
327327
w = f.weights("area", cell_measures=False, coordinates=False)
328328

329+
def test_weights_exceptions(self):
330+
f = cf.example_field(0)
331+
f.coordinate("X").del_bounds()
332+
f.coordinate("Y").del_bounds()
333+
334+
with self.assertRaisesRegex(
335+
ValueError, "Can't create weights: Unable to find cell areas"
336+
):
337+
f.weights("area")
338+
329339

330340
if __name__ == "__main__":
331341
print("Run date:", datetime.datetime.now())

0 commit comments

Comments
 (0)