From 75d41edb94d5dda7b5b7c476c1ba248d6e838755 Mon Sep 17 00:00:00 2001 From: Kei Matsumoto Date: Wed, 10 Jul 2019 12:10:19 +0900 Subject: [PATCH] fix: Add test Signed-off-by: Kei Matsumoto --- tests/unit/cli/utils_test.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/unit/cli/utils_test.py b/tests/unit/cli/utils_test.py index 26524ff37..25912f77a 100644 --- a/tests/unit/cli/utils_test.py +++ b/tests/unit/cli/utils_test.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import unittest from compose.utils import unquote_path +from compose.cli.utils import human_readable_file_size class UnquotePathTest(unittest.TestCase): @@ -21,3 +22,14 @@ class UnquotePathTest(unittest.TestCase): assert unquote_path('""hello""') == '"hello"' assert unquote_path('"hel"lo"') == 'hel"lo' assert unquote_path('"hello""') == 'hello"' + + +class HumanReadableFileSizeTest(unittest.TestCase): + def test_100b(self): + assert human_readable_file_size(100) == '100 B' + + def test_1kb(self): + assert human_readable_file_size(1024) == '1 kB' + + def test_1023b(self): + assert human_readable_file_size(1023) == '1023 B'