From 3c28f4038e5de54adb45d9213c91ed34978158be Mon Sep 17 00:00:00 2001 From: Baudouin Raoult Date: Thu, 19 Nov 2020 12:29:40 +0000 Subject: Check --- tests/requirements-dev.txt | 7 ------- tests/requirements-tests.in | 7 ------- tests/requirements-tests.txt | 9 --------- tests/requirements.txt | 9 +++++++++ tests/test_api.py | 26 +++++++++++++++++--------- 5 files changed, 26 insertions(+), 32 deletions(-) delete mode 100644 tests/requirements-dev.txt delete mode 100644 tests/requirements-tests.in delete mode 100644 tests/requirements-tests.txt create mode 100644 tests/requirements.txt (limited to 'tests') 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-tests.txt deleted file mode 100644 index ad28cc6..0000000 --- a/tests/requirements-tests.txt +++ /dev/null @@ -1,9 +0,0 @@ -# -pytest-cov -pytest-env -pytest-flakes -pytest-mccabe -pytest-pep8 -pytest-runner -pytest -requests 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 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") -- cgit v1.2.3