Пример #1
0
def test_keys_repr():
    blocks = {5: b'Hello', 12: b", World!"}
    cb = ContiguousBytes(blocks)
    assert repr(cb.keys()) == "RangeSet(start=5, stop=20)"
Пример #2
0
def test_keys_getitem():
    blocks = {5: b'Hello', 12: b", World!"}
    cb = ContiguousBytes(blocks)
    assert cb.keys()[0] == 5
Пример #3
0
def test_keys_len():
    blocks = {5: b'Hello', 12: b", World!"}
    cb = ContiguousBytes(blocks)
    assert len(cb.keys()) == 15
Пример #4
0
def test_keys_start():
    blocks = {5: b'Hello', 12: b", World!"}
    cb = ContiguousBytes(blocks)
    assert cb.keys().start == 5