tests.size.conversions_test module
Tests for operations on Size objects.
-
class tests.size.conversions_test.ConversionTestCase(methodName='runTest')
Bases: unittest.case.TestCase
Test conversions.
-
testBool()
Test conversion to bool.
Note that bool calls __bool__() in Python 3, __nonzero__ in Python2.
-
testDeepCopy()
Test that deepcopy is different but equal.
-
testFloat()
Test float conversion.
Converting a Size to a float should require some effort.
-
testInt(s=HypothesisProvided(value=integers()), u=HypothesisProvided(value=sampled_from((B, KiB, MiB, GiB, TiB, PiB, EiB, ZiB, YiB, kB, MB, GB, TB, PB, EB, ZB, YB))))
Test integer conversions.
-
testRepr(s=HypothesisProvided(value=builds(<class 'bytesize._size.Size'>, integers(), sampled_from((B, KiB, MiB, GiB, TiB, PiB, EiB, ZiB, YiB, kB, MB, GB, TB, PB, EB, ZB, YB)))))
Test that repr looks right.
-
testStr(s=HypothesisProvided(value=integers()), u=HypothesisProvided(value=sampled_from((B, KiB, MiB, GiB, TiB, PiB, EiB, ZiB, YiB, kB, MB, GB, TB, PB, EB, ZB, YB))))
Test that str result has a standard format.