summaryrefslogtreecommitdiff
path: root/tests/test_api.py
diff options
context:
space:
mode:
authorBaudouin Raoult <baudouin.raoult@ecmwf.int>2020-11-19 12:29:40 +0000
committerBaudouin Raoult <baudouin.raoult@ecmwf.int>2020-11-19 12:29:40 +0000
commit3c28f4038e5de54adb45d9213c91ed34978158be (patch)
tree752a0a6da94c0b2c1733bda4b37fa72d21fdaace /tests/test_api.py
parent99437650423ca31552e7e647532b96e7bd340189 (diff)
Check
Diffstat (limited to 'tests/test_api.py')
-rw-r--r--tests/test_api.py26
1 files changed, 17 insertions, 9 deletions
diff --git a/tests/test_api.py b/tests/test_api.py
index 2403dca..685ebe3 100644
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -1,13 +1,21 @@
-
from __future__ import absolute_import, division, print_function, unicode_literals
-from cdsapi import api
+import cdsapi
+
+
+def test_request():
+
+ c = cdsapi.Client()
+ r = c.retrieve(
+ "reanalysis-era5-single-levels",
+ {
+ "variable": "2t",
+ "product_type": "reanalysis",
+ "date": "2012-12-01",
+ "time": "14:00",
+ "format": "netcdf",
+ },
+ )
-def test_bytes_to_string():
- assert api.bytes_to_string(1) == '1'
- assert api.bytes_to_string(1 << 10) == '1K'
- assert api.bytes_to_string(1 << 20) == '1M'
- assert api.bytes_to_string(1 << 30) == '1G'
- assert api.bytes_to_string(1 << 40) == '1T'
- assert api.bytes_to_string(1 << 50) == '1P'
+ r.download("test.nc")