MCPcopy Create free account
hub / github.com/apify/crawlee-python / test_divisions

Function test_divisions

tests/unit/_utils/test_byte_size.py:98–109  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

96
97
98def 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

Callers

nothing calls this directly

Calls 1

ByteSizeClass · 0.90

Tested by

no test coverage detected