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

Function test_initializations

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

Source from the content-addressed store, hash-verified

6
7
8def test_initializations() -> None:
9 assert ByteSize(1024).bytes == 1024
10 assert ByteSize.from_kb(1).bytes == 1024
11 assert ByteSize.from_mb(1).bytes == 1024**2
12 assert ByteSize.from_gb(1).bytes == 1024**3
13 assert ByteSize.from_tb(1).bytes == 1024**4
14
15 with pytest.raises(ValueError, match=r'ByteSize cannot be negative'):
16 ByteSize(-1)
17
18
19def test_conversions() -> None:

Callers

nothing calls this directly

Calls 5

ByteSizeClass · 0.90
from_kbMethod · 0.80
from_mbMethod · 0.80
from_gbMethod · 0.80
from_tbMethod · 0.80

Tested by

no test coverage detected