diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/requirements.txt | 9 | ||||
-rw-r--r-- | tests/test_api.py | 20 |
2 files changed, 29 insertions, 0 deletions
diff --git a/tests/requirements.txt b/tests/requirements.txt new file mode 100644 index 0000000..ad28cc6 --- /dev/null +++ b/tests/requirements.txt @@ -0,0 +1,9 @@ +# +pytest-cov +pytest-env +pytest-flakes +pytest-mccabe +pytest-pep8 +pytest-runner +pytest +requests diff --git a/tests/test_api.py b/tests/test_api.py new file mode 100644 index 0000000..c3f3766 --- /dev/null +++ b/tests/test_api.py @@ -0,0 +1,20 @@ +import cdsapi +import os + +def test_request(): + + c = cdsapi.Client() + + r = c.retrieve( + "reanalysis-era5-single-levels", + { + "variable": "2t", + "product_type": "reanalysis", + "date": "2012-12-01", + "time": "12:00" + }, + ) + + r.download("test.grib") + + assert os.path.getsize("test.grib") == 2076600 |