diff options
author | Alfredo Deza <adeza@redhat.com> | 2018-08-08 18:55:16 +0200 |
---|---|---|
committer | Alfredo Deza <adeza@redhat.com> | 2018-08-10 19:14:31 +0200 |
commit | 7816fa9f90985d03c17fda31093252fc66a48146 (patch) | |
tree | eca4f31e816e342c310b1334d5ba585a0352c62a /src/ceph-volume | |
parent | ceph-volume util.disk do not modify self instance of Size objects (diff) | |
download | ceph-7816fa9f90985d03c17fda31093252fc66a48146.tar.xz ceph-7816fa9f90985d03c17fda31093252fc66a48146.zip |
ceph-volume tests.util update to reflect Size object changes
Signed-off-by: Alfredo Deza <adeza@redhat.com>
Diffstat (limited to 'src/ceph-volume')
-rw-r--r-- | src/ceph-volume/ceph_volume/tests/util/test_disk.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ceph-volume/ceph_volume/tests/util/test_disk.py b/src/ceph-volume/ceph_volume/tests/util/test_disk.py index f3c96de4589..71bfbbc3269 100644 --- a/src/ceph-volume/ceph_volume/tests/util/test_disk.py +++ b/src/ceph-volume/ceph_volume/tests/util/test_disk.py @@ -383,7 +383,7 @@ class TestSizeOperations(object): def test_self_addition_with_size_objects(self): base = disk.Size(mb=256) - base + disk.Size(gb=1) + base += disk.Size(gb=1) assert base.gb == 1.25 def test_addition_with_non_size_objects(self): @@ -392,7 +392,7 @@ class TestSizeOperations(object): def test_assignment_subtraction_with_size_objects(self): base = disk.Size(gb=1) - base - disk.Size(mb=256) + base -= disk.Size(mb=256) assert base.mb == 768 def test_subtraction_with_size_objects(self): @@ -409,12 +409,12 @@ class TestSizeOperations(object): def test_multiplication_with_non_size_objects(self): base = disk.Size(gb=1) - base * 2 - assert base.gb == 2 + result = base * 2 + assert result.gb == 2 def test_division_with_size_objects(self): - with pytest.raises(TypeError): - disk.Size(gb=1) * disk.Size(mb=1) + result = disk.Size(gb=1) / disk.Size(mb=1) + assert int(result) == 1024 def test_division_with_non_size_objects(self): base = disk.Size(gb=1) |