summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGard Spreemann <gspr@nonempty.org>2020-11-20 08:50:11 +0100
committerGard Spreemann <gspr@nonempty.org>2020-11-20 08:50:11 +0100
commit91efa9aec225b2871936a0ff12b7292862270299 (patch)
treead41b622dd12e5b903076c2c32edc3c659de5749 /tests
parentcd5c24d86e8205dd180871c2365eaf4b6823bd5c (diff)
parentc4a66d68b3bf98371d3de3328558d3e89f63db61 (diff)
Merge tag 'upstream/0.4.0' into debian/sid
Upstream 0.4.0 tarball as released on PyPI.
Diffstat (limited to 'tests')
-rw-r--r--tests/requirements-dev.txt7
-rw-r--r--tests/requirements-tests.in7
-rw-r--r--tests/requirements.txt (renamed from tests/requirements-tests.txt)0
-rw-r--r--tests/test_api.py25
4 files changed, 16 insertions, 23 deletions
diff --git a/tests/requirements-dev.txt b/tests/requirements-dev.txt
deleted file mode 100644
index 049cc41..0000000
--- a/tests/requirements-dev.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-check-manifest
-detox
-pip-tools
-pyroma
-tox
-tox-pyenv
-zest.releaser
diff --git a/tests/requirements-tests.in b/tests/requirements-tests.in
deleted file mode 100644
index 1017996..0000000
--- a/tests/requirements-tests.in
+++ /dev/null
@@ -1,7 +0,0 @@
-pytest
-pytest-flakes
-pytest-cov
-pytest-env
-pytest-mccabe
-pytest-pep8
-pytest-runner
diff --git a/tests/requirements-tests.txt b/tests/requirements.txt
index ad28cc6..ad28cc6 100644
--- a/tests/requirements-tests.txt
+++ b/tests/requirements.txt
diff --git a/tests/test_api.py b/tests/test_api.py
index 2403dca..c3f3766 100644
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -1,13 +1,20 @@
+import cdsapi
+import os
-from __future__ import absolute_import, division, print_function, unicode_literals
+def test_request():
-from cdsapi import api
+ c = cdsapi.Client()
+ r = c.retrieve(
+ "reanalysis-era5-single-levels",
+ {
+ "variable": "2t",
+ "product_type": "reanalysis",
+ "date": "2012-12-01",
+ "time": "12:00"
+ },
+ )
-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.grib")
+
+ assert os.path.getsize("test.grib") == 2076600