From: Alfredo Deza Date: Fri, 21 Dec 2018 20:26:39 +0000 (-0500) Subject: ceph-volume test verify strings with a comma can be converted to ints X-Git-Tag: v12.2.11~68^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=b1a9754fbf2b20ee1ba375f56264ac10601aeece;p=ceph.git ceph-volume test verify strings with a comma can be converted to ints Signed-off-by: Alfredo Deza (cherry picked from commit 818902e568adaefecc6da9afee58b3a804a0e4d0) --- diff --git a/src/ceph-volume/ceph_volume/tests/util/test_util.py b/src/ceph-volume/ceph_volume/tests/util/test_util.py index 82f2ef27f6471..edea219fdad91 100644 --- a/src/ceph-volume/ceph_volume/tests/util/test_util.py +++ b/src/ceph-volume/ceph_volume/tests/util/test_util.py @@ -15,6 +15,14 @@ class TestAsBytes(object): class TestStrToInt(object): + def test_passing_a_float_str_comma(self): + result = util.str_to_int("1,99") + assert result == 1 + + def test_passing_a_float_does_not_round_comma(self): + result = util.str_to_int("1,99", round_down=False) + assert result == 2 + def test_passing_a_float_str(self): result = util.str_to_int("1.99") assert result == 1