summaryrefslogtreecommitdiff
path: root/tests/test_api.py
diff options
context:
space:
mode:
authorGard Spreemann <gspr@nonempty.org>2021-08-14 20:33:19 +0200
committerGard Spreemann <gspr@nonempty.org>2021-08-14 20:33:19 +0200
commit4e608966f4cd5ea995189f8a23e00e4154ddf2a9 (patch)
tree6ee9bae4145ff00c595f3635db027c8549a84f4d /tests/test_api.py
parentb70a5361202307c26bac18d15453b5193a22f11c (diff)
parentf3b94a9bc40f8d56b0d1ac8cc8bc84765509ef05 (diff)
Merge tag '0.5.1' into debian/sid
Diffstat (limited to 'tests/test_api.py')
-rw-r--r--tests/test_api.py20
1 files changed, 20 insertions, 0 deletions
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