summaryrefslogtreecommitdiff
path: root/tests/test_api.py
blob: 2403dcab922b1d33a9a1ee62c28c4a4ba05a4d60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
from __future__ import absolute_import, division, print_function, unicode_literals

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'