Skip to content

Commit 3a05b8e

Browse files
committed
fix tests
1 parent 4f158f6 commit 3a05b8e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/pulsar_test.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,9 @@ def test_encryption_failure(self):
495495
)
496496
producer.send(b"msg-0")
497497

498-
def verify_encryption_context(context: pulsar.EncryptionContext, failed: bool, batch_size: int):
498+
def verify_encryption_context(context: pulsar.EncryptionContext | None, failed: bool, batch_size: int):
499+
if context is None:
500+
self.fail("Encryption context is None")
499501
keys = context.keys()
500502
self.assertEqual(len(keys), 1)
501503
key = keys[0]
@@ -505,7 +507,7 @@ def verify_encryption_context(context: pulsar.EncryptionContext, failed: bool, b
505507
self.assertTrue(len(context.param()) > 0)
506508
self.assertEqual(context.algorithm(), "")
507509
self.assertEqual(context.compression_type(), CompressionType.LZ4)
508-
if batch_size == 1:
510+
if batch_size == -1:
509511
self.assertEqual(context.uncompressed_message_size(), len(b"msg-0"))
510512
else:
511513
self.assertGreater(context.uncompressed_message_size(), len(b"msg-0"))

0 commit comments

Comments
 (0)