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

Function test_additions

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

Source from the content-addressed store, hash-verified

45
46
47def 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
62def test_subtractions() -> None:

Callers

nothing calls this directly

Calls 1

ByteSizeClass · 0.90

Tested by

no test coverage detected