From 818902e568adaefecc6da9afee58b3a804a0e4d0 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Fri, 21 Dec 2018 15:26:39 -0500 Subject: [PATCH] ceph-volume test verify strings with a comma can be converted to ints Signed-off-by: Alfredo Deza --- src/ceph-volume/ceph_volume/tests/util/test_util.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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 82f2ef27f64..edea219fdad 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 -- 2.39.5