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