Skip to content

Commit 57bfe8e

Browse files
committed
Code format and fix unit test.
1 parent afc6cb4 commit 57bfe8e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pulsar/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,9 +615,11 @@ def create_producer(self, topic,
615615
crypto_key_reader: CryptoKeyReader, optional
616616
Symmetric encryption class implementation, configuring public key encryption messages for the producer
617617
and private key decryption messages for the consumer
618-
access_mode: ProducerAccessMode, default=ProducerAccessMode.Shared
618+
access_mode: ProducerAccessMode, optional
619619
Set the type of access mode that the producer requires on the topic.
620+
620621
Supported modes:
622+
621623
* Shared: By default multiple producers can publish on a topic.
622624
* Exclusive: Require exclusive access for producer.
623625
Fail immediately if there's already a producer connected.

tests/pulsar_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def test_producer_access_mode_exclusive_with_fencing(self):
216216
assert producer2.producer_name() == 'p-2'
217217

218218
# producer1 will be fenced.
219-
with self.assertRaises(pulsar.ProducerFenced):
219+
with self.assertRaises((pulsar.ProducerFenced, pulsar.AlreadyClosed)):
220220
producer1.send('test-msg'.encode('utf-8'))
221221

222222
producer2.close()

0 commit comments

Comments
 (0)