diff options
| author | Anca Iordache <aiordache@users.noreply.github.com> | 2020-08-17 18:32:48 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-17 18:32:48 +0200 |
| commit | 2c522fb362247a692c0493f0b47a33988eb2f3e3 (patch) | |
| tree | a71373e39c3c1e422029347af18eb67def7d11f1 /tests/unit | |
| parent | 30ff9f339cfb15ea00d0c6b1b3b675de3c80e8dd (diff) | |
| download | docker-py-2c522fb362247a692c0493f0b47a33988eb2f3e3.tar.gz | |
Fix memory conversion to bytes (#2645)
* Fix memory conversion to bytes
Co-authored-by: Ulysses Souza <ulysses.souza@gmail.com>
Signed-off-by: aiordache <anca.iordache@docker.com>
Diffstat (limited to 'tests/unit')
| -rw-r--r-- | tests/unit/utils_test.py | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/tests/unit/utils_test.py b/tests/unit/utils_test.py index d9cb002..07209a1 100644 --- a/tests/unit/utils_test.py +++ b/tests/unit/utils_test.py @@ -5,27 +5,21 @@ import json import os import os.path import shutil -import sys import tempfile import unittest - +import pytest +import six from docker.api.client import APIClient from docker.constants import IS_WINDOWS_PLATFORM from docker.errors import DockerException -from docker.utils import ( - convert_filters, convert_volume_binds, decode_json_header, kwargs_from_env, - parse_bytes, parse_devices, parse_env_file, parse_host, - parse_repository_tag, split_command, update_headers, -) - +from docker.utils import (convert_filters, convert_volume_binds, + decode_json_header, kwargs_from_env, parse_bytes, + parse_devices, parse_env_file, parse_host, + parse_repository_tag, split_command, update_headers) from docker.utils.ports import build_port_bindings, split_port from docker.utils.utils import format_environment -import pytest - -import six - TEST_CERT_DIR = os.path.join( os.path.dirname(__file__), 'testdata/certs', @@ -447,11 +441,7 @@ class ParseBytesTest(unittest.TestCase): parse_bytes("127.0.0.1K") def test_parse_bytes_float(self): - with pytest.raises(DockerException): - parse_bytes("1.5k") - - def test_parse_bytes_maxint(self): - assert parse_bytes("{0}k".format(sys.maxsize)) == sys.maxsize * 1024 + assert parse_bytes("1.5k") == 1536 class UtilsTest(unittest.TestCase): |
