File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -111,19 +111,19 @@ def test_producer_sync_fail_on_error(self):
111
111
with self .assertRaises (FailedPayloadsError ):
112
112
producer .send_messages ('foobar' , b'test message' )
113
113
114
- def test_cleanup_stop_is_called_on_not_stopped_object (self ):
114
+ def test_cleanup_is_not_called_on_stopped_producer (self ):
115
115
producer = Producer (MagicMock (), async = True )
116
116
producer .stopped = True
117
- with patch ( 'kafka. producer.base.Producer. stop' ) as base_stop :
117
+ with patch . object ( producer , ' stop' ) as mocked_stop :
118
118
producer ._cleanup_func (producer )
119
- self .assertEqual (base_stop .call_count , 0 )
119
+ self .assertEqual (mocked_stop .call_count , 0 )
120
120
121
- def test_cleanup_stop_is_not_called_on_stopped_object (self ):
121
+ def test_cleanup_is_called_on_running_producer (self ):
122
122
producer = Producer (MagicMock (), async = True )
123
123
producer .stopped = False
124
- with patch ( 'kafka. producer.base.Producer. stop' ) as base_stop :
124
+ with patch . object ( producer , ' stop' ) as mocked_stop :
125
125
producer ._cleanup_func (producer )
126
- self .assertEqual (base_stop .call_count , 1 )
126
+ self .assertEqual (mocked_stop .call_count , 1 )
127
127
128
128
129
129
class TestKafkaProducerSendUpstream (unittest .TestCase ):
You can’t perform that action at this time.
0 commit comments