mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +00:00
Remove __abs__ from bytes and sectors, one should convert to int instead
This commit is contained in:
parent
7f84e405f0
commit
b537f2d987
4 changed files with 4 additions and 10 deletions
|
@ -72,9 +72,6 @@ class Bytes(object):
|
||||||
def __long__(self):
|
def __long__(self):
|
||||||
return self.qty
|
return self.qty
|
||||||
|
|
||||||
def __abs__(self):
|
|
||||||
return self.qty
|
|
||||||
|
|
||||||
@onlybytes('Can only compare Bytes to Bytes')
|
@onlybytes('Can only compare Bytes to Bytes')
|
||||||
def __lt__(self, other):
|
def __lt__(self, other):
|
||||||
return self.qty < other.qty
|
return self.qty < other.qty
|
||||||
|
|
|
@ -43,9 +43,6 @@ class Sectors(object):
|
||||||
def __long__(self):
|
def __long__(self):
|
||||||
return self.get_sectors()
|
return self.get_sectors()
|
||||||
|
|
||||||
def __abs__(self):
|
|
||||||
return self.get_sectors()
|
|
||||||
|
|
||||||
@onlysectors('Can only compare sectors with sectors')
|
@onlysectors('Can only compare sectors with sectors')
|
||||||
def __lt__(self, other):
|
def __lt__(self, other):
|
||||||
return self.bytes < other.bytes
|
return self.bytes < other.bytes
|
||||||
|
|
|
@ -104,5 +104,5 @@ def test_imod_int():
|
||||||
b %= 5
|
b %= 5
|
||||||
|
|
||||||
|
|
||||||
def test_abs():
|
def test_convert_int():
|
||||||
eq_(pow(1024, 3), abs(Bytes('1GiB')))
|
eq_(pow(1024, 3), int(Bytes('1GiB')))
|
||||||
|
|
|
@ -123,6 +123,6 @@ def test_imod_int():
|
||||||
s %= 5
|
s %= 5
|
||||||
|
|
||||||
|
|
||||||
def test_abs():
|
def test_convert_int():
|
||||||
secsize = 512
|
secsize = 512
|
||||||
eq_(pow(1024, 3) / secsize, abs(Sectors('1GiB', secsize)))
|
eq_(pow(1024, 3) / secsize, int(Sectors('1GiB', secsize)))
|
||||||
|
|
Loading…
Add table
Reference in a new issue