Skip to content

Commit 3cfe8ee

Browse files
committed
Fix tests
1 parent 86e4aa6 commit 3cfe8ee

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

era5cli/key_management.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def attempt_cds_login(url: str, key: str) -> True:
4848
"product_type": "reanalysis",
4949
"date": "2012-12-01",
5050
"time": "14:00",
51-
"format": "netcdf",
51+
"data_format": "netcdf",
5252
},
5353
)
5454
return True

tests/test_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def test_parse_args():
3535
assert not args.merge
3636
assert args.startyear == 2008
3737
assert args.statistics
38-
assert not args.threads
38+
assert args.threads == 1
3939
assert args.variables == ["total_precipitation"]
4040
assert args.land
4141
assert not args.area

tests/test_fetch.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,8 @@ def test_build_request():
472472
"month": ALL_MONTHS,
473473
"day": ALL_DAYS,
474474
"time": ALL_HOURS,
475-
"format": "netcdf",
475+
"data_format": "netcdf",
476+
"download_format": "unarchived",
476477
}
477478
assert request == req
478479

@@ -486,7 +487,8 @@ def test_build_request():
486487
"product_type": "monthly_averaged_ensemble_members",
487488
"month": ALL_MONTHS,
488489
"time": ALL_HOURS,
489-
"format": "netcdf",
490+
"data_format": "netcdf",
491+
"download_format": "unarchived",
490492
}
491493
assert request == req
492494

@@ -503,7 +505,8 @@ def test_build_request():
503505
"product_type": "monthly_averaged_reanalysis",
504506
"month": ALL_MONTHS,
505507
"time": ["00:00"],
506-
"format": "netcdf",
508+
"data_format": "netcdf",
509+
"download_format": "unarchived",
507510
}
508511
assert request == req
509512

tests/test_integration.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ def my_thing_mock():
3232
'03:00', '04:00', '05:00', '06:00', '07:00', '08:00', '09:00',
3333
'10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00',
3434
'17:00', '18:00', '19:00', '20:00', '21:00', '22:00', '23:00'],
35-
'format': 'netcdf', 'product_type': 'reanalysis', 'day': ['01',
35+
'data_format': 'netcdf', 'download_format': 'unarchived',
36+
'product_type': 'reanalysis', 'day': ['01',
3637
'02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12',
3738
'13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23',
3839
'24', '25', '26', '27', '28', '29', '30', '31']}
@@ -55,7 +56,8 @@ def my_thing_mock():
5556
'03:00', '04:00', '05:00', '06:00', '07:00', '08:00', '09:00',
5657
'10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00',
5758
'17:00', '18:00', '19:00', '20:00', '21:00', '22:00', '23:00'],
58-
'format': 'netcdf', 'pressure_level': [1, 2, 3, 5, 7, 10, 20, 30,
59+
'data_format': 'netcdf', 'download_format': 'unarchived',
60+
'pressure_level': [1, 2, 3, 5, 7, 10, 20, 30,
5961
50, 70, 100, 125, 150, 175, 200, 225, 250, 300, 350, 400, 450, 500,
6062
550, 600, 650, 700, 750, 775, 800, 825, 850, 875, 900, 925, 950,
6163
975, 1000], 'product_type': 'reanalysis', 'day': ['01', '02', '03',
@@ -77,8 +79,8 @@ def my_thing_mock():
7779
"""\
7880
reanalysis-era5-land-monthly-means {'variable': 'snow_cover',
7981
'year': 2008, 'month': ['01', '02', '03', '04', '05', '06', '07',
80-
'08', '09', '10', '11', '12'], 'time': ['00:00'], 'format':
81-
'netcdf', 'product_type': 'monthly_averaged_reanalysis'}
82+
'08', '09', '10', '11', '12'], 'time': ['00:00'], 'data_format': 'netcdf',
83+
'download_format': 'unarchived', 'product_type': 'monthly_averaged_reanalysis'}
8284
era5-land_snow_cover_2008_monthly.nc"""
8385
),
8486
},

0 commit comments

Comments
 (0)