Ejemplo n.º 1
0
def test_ge():
	assert Bytes('2MiB') >= Bytes('1MiB')
	assert Bytes('2MiB') >= Bytes('2MiB')
Ejemplo n.º 2
0
def test_neq():
	assert Bytes('15MiB') != Bytes('1MiB')
Ejemplo n.º 3
0
def test_gt():
	assert Bytes('2MiB') > Bytes('1MiB')
Ejemplo n.º 4
0
def test_mul_bytes():
    Bytes('1GiB') * Bytes('1GiB')
Ejemplo n.º 5
0
def test_eq():
	eq_(Bytes('1MiB'), Bytes('1MiB'))
Ejemplo n.º 6
0
def test_iadd():
	b = Bytes('1GiB')
	b += Bytes('1GiB')
	eq_(Bytes('2GiB'), b)
Ejemplo n.º 7
0
def test_isub():
	b = Bytes('2GiB')
	b -= Bytes('1GiB')
	eq_(Bytes('1GiB'), b)
Ejemplo n.º 8
0
def test_mod_int():
    Bytes('1GiB') % 768
Ejemplo n.º 9
0
def test_imod():
    b = Bytes('1GiB')
    b %= Bytes('768MiB')
    eq_(Bytes('256MiB'), b)
Ejemplo n.º 10
0
def test_idiv():
    b = Bytes('2GiB')
    b /= 2
    eq_(Bytes('1GiB'), b)
Ejemplo n.º 11
0
def test_mod():
    eq_(Bytes('256MiB'), Bytes('1GiB') % Bytes('768MiB'))
Ejemplo n.º 12
0
def test_div_bytes():
    eq_(2, Bytes('2GiB') / Bytes('1GiB'))
Ejemplo n.º 13
0
def test_div():
    eq_(Bytes('1GiB'), Bytes('2GiB') / 2)
Ejemplo n.º 14
0
def test_imul():
    b = Bytes('1GiB')
    b *= 2
    eq_(Bytes('2GiB'), b)
Ejemplo n.º 15
0
def test_eq_unit():
	eq_(Bytes('1024MiB'), Bytes('1GiB'))
Ejemplo n.º 16
0
def test_le():
	assert Bytes('1MiB') <= Bytes('2MiB')
	assert Bytes('1MiB') <= Bytes('1MiB')
Ejemplo n.º 17
0
def test_add():
	eq_(Bytes('2GiB'), Bytes('1GiB') + Bytes('1GiB'))
Ejemplo n.º 18
0
def test_imod_int():
	b = Bytes('1GiB')
	b %= 5
Ejemplo n.º 19
0
def test_sub():
	eq_(Bytes('1GiB'), Bytes('2GiB') - Bytes('1GiB'))
Ejemplo n.º 20
0
def test_convert_int():
	eq_(pow(1024, 3), int(Bytes('1GiB')))
Ejemplo n.º 21
0
def test_mul():
	eq_(Bytes('2GiB'), Bytes('1GiB') * 2)
Ejemplo n.º 22
0
def test_lt():
    assert Bytes('1MiB') < Bytes('2MiB')