Skip to content

Commit fd5ac7a

Browse files
committed
make assign assertion more concise
1 parent 859f7e5 commit fd5ac7a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/test_listen.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from unittest import mock
22

3+
from confluent_kafka import TopicPartition
4+
35
from saluki.listen import listen
46

57

@@ -14,8 +16,7 @@ def test_listen_with_partition_assigns_to_partition():
1416
mock.patch("saluki.listen.Consumer") as c,
1517
):
1618
listen("somebroker", "sometopic", partition=expected_partition)
17-
assert c.return_value.assign.call_args[0][0][0].topic == topic
18-
assert c.return_value.assign.call_args[0][0][0].partition == expected_partition
19+
c.return_value.assign.assert_called_with([TopicPartition(topic, expected_partition)])
1920

2021

2122
def test_keyboard_interrupt_causes_consumer_to_close():

0 commit comments

Comments
 (0)