()
| 45 | |
| 46 | |
| 47 | def test_additions() -> None: |
| 48 | # Addition of ByteSize instances |
| 49 | size1 = ByteSize(1024) |
| 50 | size2 = ByteSize(2048) |
| 51 | assert (size1 + size2).bytes == 3072 |
| 52 | |
| 53 | # Addition of ByteSize instance and an int |
| 54 | with pytest.raises(TypeError): |
| 55 | _ = size1 + 1024 |
| 56 | |
| 57 | # Addition of ByteSize instance and an float |
| 58 | with pytest.raises(TypeError): |
| 59 | _ = size2 + 123.45 |
| 60 | |
| 61 | |
| 62 | def test_subtractions() -> None: |