Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion climada/test/test_litpop_integr.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ def test_netherlands150_pass(self):
self.assertEqual(ent.gdf.shape[0], 2829)

def test_BLM150_pass(self):
"""Test from_countries for BLM at 150 arcsec, 2 data points"""
"""Test from_countries for BLM at 150 arcsec, 2 data points
The world bank doesn't provide data for Saint Barthélemy, fall back to natearth
"""
ent = lp.LitPop.from_countries("BLM", res_arcsec=150, reference_year=2016)
self.assertEqual(ent.gdf.shape[0], 2)

Expand Down
2 changes: 1 addition & 1 deletion climada/util/finance.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def download_world_bank_indicator(
# Check if we received an error message
try:
if json_data[0]["message"][0]["id"] == "120":
raise RuntimeError(
raise ValueError(
"Error requesting data from the World Bank API. Did you use the "
"correct country code and indicator ID?"
)
Expand Down
4 changes: 2 additions & 2 deletions climada/util/test/test_finance.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,12 @@ def test_download_wb_data(self):

# Check errors raised
with self.assertRaisesRegex(
RuntimeError,
ValueError,
"Did you use the correct country code",
):
download_world_bank_indicator("Spain", "NY.GDP.MKTP.CD")
with self.assertRaisesRegex(
RuntimeError,
ValueError,
"Did you use the correct country code",
):
download_world_bank_indicator("ESP", "BogusIndicator")
Expand Down
Loading