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