Skip to content

Commit 987d585

Browse files
authored
test: exercise zstd compression (#39)
1 parent 2106eda commit 987d585

1 file changed

Lines changed: 5 additions & 26 deletions

File tree

tests/test_stream_ops.py

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
S2Stream,
2626
SeqNum,
2727
SeqNumMismatchError,
28-
StorageClass,
2928
StreamConfig,
3029
TailOffset,
3130
Timestamp,
@@ -766,28 +765,18 @@ async def test_read_session_beyond_tail_errors(self, stream: S2Stream):
766765

767766

768767
@pytest.mark.stream
769-
@pytest.mark.parametrize("compression", [Compression.GZIP])
768+
@pytest.mark.parametrize("compression", [Compression.GZIP, Compression.ZSTD])
770769
class TestCompression:
771770
async def test_compression_roundtrip_unary(
772771
self, access_token: str, endpoints: Endpoints | None, compression: Compression
773772
):
774773
async with S2(access_token, endpoints=endpoints, compression=compression) as s2:
775774
basin_name = f"test-py-sdk-{uuid.uuid4().hex[:8]}"
776-
await s2.create_basin(
777-
name=basin_name,
778-
config=BasinConfig(
779-
default_stream_config=StreamConfig(
780-
storage_class=StorageClass.STANDARD
781-
)
782-
),
783-
)
775+
await s2.create_basin(basin_name)
784776
try:
785777
basin = s2.basin(basin_name)
786778
stream_name = f"stream-{uuid.uuid4().hex[:8]}"
787-
await basin.create_stream(
788-
name=stream_name,
789-
config=StreamConfig(timestamping=Timestamping(uncapped=True)),
790-
)
779+
await basin.create_stream(stream_name)
791780
try:
792781
stream = basin.stream(stream_name)
793782
ack = await stream.append(
@@ -813,21 +802,11 @@ async def test_compression_roundtrip_session(
813802
):
814803
async with S2(access_token, endpoints=endpoints, compression=compression) as s2:
815804
basin_name = f"test-py-sdk-{uuid.uuid4().hex[:8]}"
816-
await s2.create_basin(
817-
name=basin_name,
818-
config=BasinConfig(
819-
default_stream_config=StreamConfig(
820-
timestamping=Timestamping(mode=TimestampingMode.ARRIVAL)
821-
)
822-
),
823-
)
805+
await s2.create_basin(basin_name)
824806
try:
825807
basin = s2.basin(basin_name)
826808
stream_name = f"stream-{uuid.uuid4().hex[:8]}"
827-
await basin.create_stream(
828-
name=stream_name,
829-
config=StreamConfig(storage_class=StorageClass.STANDARD),
830-
)
809+
await basin.create_stream(stream_name)
831810
try:
832811
stream = basin.stream(stream_name)
833812
# Payload >= 1KiB to trigger compression

0 commit comments

Comments
 (0)