summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Amici <a.amici@bopen.eu>2018-05-15 20:09:53 +0200
committerAlessandro Amici <a.amici@bopen.eu>2018-05-15 20:09:53 +0200
commita71e21abde0f45155c86d044bf609a7d37a891ba (patch)
treeefc6b77bd4c4ffad8140da6c5ce756a308011350
parent23678c55a90ab8a5bb283b7d66742ca9973d7177 (diff)
Add first test and sync MANIFEST.
-rw-r--r--MANIFEST.in2
-rw-r--r--tests/test_api.py11
2 files changed, 13 insertions, 0 deletions
diff --git a/MANIFEST.in b/MANIFEST.in
index 07b2794..e009529 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,3 +1,5 @@
include *.in
include *.rst
+include *.py
recursive-include cdsapi *.py
+recursive-include tests *.py \ No newline at end of file
diff --git a/tests/test_api.py b/tests/test_api.py
new file mode 100644
index 0000000..f76a842
--- /dev/null
+++ b/tests/test_api.py
@@ -0,0 +1,11 @@
+
+from cdsapi import api
+
+
+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'