()
| 96 | |
| 97 | |
| 98 | def test_divisions() -> None: |
| 99 | # Division of ByteSize by another ByteSize |
| 100 | size1 = ByteSize(2048) |
| 101 | size2 = ByteSize(1024) |
| 102 | assert (size1 / size2) == 2 |
| 103 | |
| 104 | # Division by zero when the divisor is a ByteSize with zero bytes |
| 105 | with pytest.raises(ZeroDivisionError): |
| 106 | _ = size1 / ByteSize(0) |
| 107 | |
| 108 | # Division of ByteSize - multiplying by a float |
| 109 | assert (size1 * 0.5).bytes == 1024 |