(s3, fmt, blocksize, s3so)
| 384 | [(fmt, None) for fmt in compr] + [(fmt, 10) for fmt in compr], |
| 385 | ) |
| 386 | def test_compression(s3, fmt, blocksize, s3so): |
| 387 | if fmt not in compress: |
| 388 | pytest.skip("compression function not provided") |
| 389 | s3._cache.clear() |
| 390 | with s3_context("compress", valmap(compress[fmt], files)): |
| 391 | if fmt and blocksize: |
| 392 | with pytest.raises(ValueError): |
| 393 | read_bytes( |
| 394 | "s3://compress/test/accounts.*", |
| 395 | compression=fmt, |
| 396 | blocksize=blocksize, |
| 397 | **s3so, |
| 398 | ) |
| 399 | return |
| 400 | sample, values = read_bytes( |
| 401 | "s3://compress/test/accounts.*", |
| 402 | compression=fmt, |
| 403 | blocksize=blocksize, |
| 404 | **s3so, |
| 405 | ) |
| 406 | assert sample.startswith(files[sorted(files)[0]][:10]) |
| 407 | assert sample.endswith(b"\n") |
| 408 | |
| 409 | results = compute(*concat(values)) |
| 410 | assert b"".join(results) == b"".join([files[k] for k in sorted(files)]) |
| 411 | |
| 412 | |
| 413 | @pytest.mark.parametrize("mode", ["rt", "rb"]) |
nothing calls this directly
no test coverage detected
searching dependent graphs…