예제 #1
0
def test_skip_length():
    data = NumpyIO(bytearray(2**21))
    for num in [1, 63, 64, 64 * 127, 64 * 128, 63 * 128**2, 64 * 128**2]:
        block, _ = writer.make_definitions(np.zeros(num), True)
        data.seek(0, 0)
        core.skip_definition_bytes(data, num)
        assert len(block) == data.tell()
예제 #2
0
def test_skip_length():
    class MockIO:
        loc = 0
    for num in [1, 63, 64, 64*127, 64*128, 63*128**2, 64*128**2]:
        block, _ = writer.make_definitions(np.zeros(num), True)
        MockIO.loc = 0
        core.skip_definition_bytes(MockIO, num)
        assert len(block) == MockIO.loc
예제 #3
0
def test_skip_length():
    class MockIO:
        loc = 0
    for num in [1, 63, 64, 64*127, 64*128, 63*128**2, 64*128**2]:
        block, _ = writer.make_definitions(np.zeros(num), True)
        MockIO.loc = 0
        core.skip_definition_bytes(MockIO, num)
        assert len(block) == MockIO.loc