@@ -417,8 +417,8 @@ def test_load_metadata(self, protocol, conn):
417
417
418
418
# client loads metadata at init
419
419
client = KafkaClient (host = 'broker_1' , port = 4567 )
420
- self .assertItemsEqual ({
421
- TopicAndPartition ('topic_1' , 0 ): brokers [0 ],
420
+ self .assertDictEqual ({
421
+ TopicAndPartition ('topic_1' , 0 ): brokers [1 ],
422
422
TopicAndPartition ('topic_noleader' , 0 ): None ,
423
423
TopicAndPartition ('topic_noleader' , 1 ): None ,
424
424
TopicAndPartition ('topic_3' , 0 ): brokers [0 ],
@@ -443,7 +443,7 @@ def test_get_leader_for_partitions_reloads_metadata(self, protocol, conn):
443
443
client = KafkaClient (host = 'broker_1' , port = 4567 )
444
444
445
445
# topic metadata is loaded but empty
446
- self .assertItemsEqual ({}, client .topics_to_brokers )
446
+ self .assertDictEqual ({}, client .topics_to_brokers )
447
447
448
448
topics ['topic_no_partitions' ] = {
449
449
0 : PartitionMetadata ('topic_no_partitions' , 0 , 0 , [0 , 1 ], [0 , 1 ])
@@ -455,7 +455,7 @@ def test_get_leader_for_partitions_reloads_metadata(self, protocol, conn):
455
455
leader = client ._get_leader_for_partition ('topic_no_partitions' , 0 )
456
456
457
457
self .assertEqual (brokers [0 ], leader )
458
- self .assertItemsEqual ({
458
+ self .assertDictEqual ({
459
459
TopicAndPartition ('topic_no_partitions' , 0 ): brokers [0 ]},
460
460
client .topics_to_brokers )
461
461
@@ -475,7 +475,7 @@ def test_get_leader_for_unassigned_partitions(self, protocol, conn):
475
475
476
476
client = KafkaClient (host = 'broker_1' , port = 4567 )
477
477
478
- self .assertItemsEqual ({}, client .topics_to_brokers )
478
+ self .assertDictEqual ({}, client .topics_to_brokers )
479
479
self .assertRaises (
480
480
PartitionUnavailableError ,
481
481
client ._get_leader_for_partition ,
@@ -500,7 +500,7 @@ def test_get_leader_returns_none_when_noleader(self, protocol, conn):
500
500
protocol .decode_metadata_response .return_value = (brokers , topics )
501
501
502
502
client = KafkaClient (host = 'broker_1' , port = 4567 )
503
- self .assertItemsEqual (
503
+ self .assertDictEqual (
504
504
{
505
505
TopicAndPartition ('topic_noleader' , 0 ): None ,
506
506
TopicAndPartition ('topic_noleader' , 1 ): None
0 commit comments