Skip to content

Commit

Permalink
ceph-volume tests.util update to reflect Size object changes
Browse files Browse the repository at this point in the history
Signed-off-by: Alfredo Deza <adeza@redhat.com>
(cherry picked from commit 7816fa9)
  • Loading branch information
Alfredo Deza authored and andrewschoen committed Aug 28, 2018
1 parent 1a1ff73 commit 04cd87d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/ceph-volume/ceph_volume/tests/util/test_disk.py
Expand Up @@ -383,7 +383,7 @@ def test_assignment_addition_with_size_objects(self):

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):
Expand All @@ -392,7 +392,7 @@ def test_addition_with_non_size_objects(self):

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):
Expand All @@ -409,12 +409,12 @@ def test_multiplication_with_size_objects(self):

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)
Expand Down

0 comments on commit 04cd87d

Please sign in to comment.