| 1 |
import pytest |
| 2 |
import lz4.frame as lz4frame |
| 3 |
import lz4 |
| 4 |
|
| 5 |
|
| 6 |
@pytest.fixture( |
| 7 |
params=[ |
| 8 |
|
| 9 |
(lz4frame.BLOCKSIZE_MAX64KB), |
| 10 |
(lz4frame.BLOCKSIZE_MAX256KB), |
| 11 |
(lz4frame.BLOCKSIZE_MAX1MB), |
| 12 |
(lz4frame.BLOCKSIZE_MAX4MB), |
| 13 |
] |
| 14 |
) |
| 15 |
def block_size(request): |
| 16 |
return request.param |
| 17 |
|
| 18 |
|
| 19 |
@pytest.fixture( |
| 20 |
params=[ |
| 21 |
(True), |
| 22 |
(False), |
| 23 |
] |
| 24 |
) |
| 25 |
def block_linked(request): |
| 26 |
return request.param |
| 27 |
|
| 28 |
|
| 29 |
@pytest.fixture( |
| 30 |
params=[ |
| 31 |
(True), |
| 32 |
(False), |
| 33 |
] |
| 34 |
) |
| 35 |
def content_checksum(request): |
| 36 |
return request.param |
| 37 |
|
| 38 |
|
| 39 |
if lz4.library_version_number() >= 10800: |
| 40 |
p = [True, False] |
| 41 |
else: |
| 42 |
p = [False, ] |
| 43 |
|
| 44 |
|
| 45 |
@pytest.fixture( |
| 46 |
params=[ |
| 47 |
(pp) for pp in p |
| 48 |
] |
| 49 |
) |
| 50 |
def block_checksum(request): |
| 51 |
return request.param |
| 52 |
|
| 53 |
|
| 54 |
compression_levels = [ |
| 55 |
(lz4frame.COMPRESSIONLEVEL_MIN), |
| 56 |
(lz4frame.COMPRESSIONLEVEL_MINHC), |
| 57 |
(lz4frame.COMPRESSIONLEVEL_MAX), |
| 58 |
] |
| 59 |
|
| 60 |
|
| 61 |
@pytest.fixture( |
| 62 |
params=compression_levels |
| 63 |
) |
| 64 |
def compression_level(request): |
| 65 |
return request.param |
| 66 |
|
| 67 |
|
| 68 |
@pytest.fixture( |
| 69 |
params=[ |
| 70 |
(True), |
| 71 |
(False) |
| 72 |
] |
| 73 |
) |
| 74 |
def auto_flush(request): |
| 75 |
return request.param |
| 76 |
|
| 77 |
|
| 78 |
@pytest.fixture( |
| 79 |
params=[ |
| 80 |
(True), |
| 81 |
(False) |
| 82 |
] |
| 83 |
) |
| 84 |
def store_size(request): |
| 85 |
return request.param |
| 86 |
|
| 87 |
|
| 88 |
@pytest.fixture( |
| 89 |
params=[ |
| 90 |
(True), |
| 91 |
(False), |
| 92 |
] |
| 93 |
) |
| 94 |
def return_bytearray(request): |
| 95 |
return request.param |