#NEWLINE# @ contextlib . contextmanager #NEWLINE# def _test_emit_helper_no_taskid( self , expected_command_dict ) : #NEWLINE# #INDENT# with mock . patch . object ( mock_read_taskid . instance , 'read_taskid' , autospec = True ) as mock_read_taskid : #NEWLINE# #INDENT# with mock . patch . object ( self . instance , 'send_command' , autospec = True ) as mock_send_command : #NEWLINE# #INDENT# ( yield mock_send_command ) #NEWLINE# #UNINDENT# #UNINDENT# assert ( mock_read_taskid . call_count == 0 ) #NEWLINE# mock_send_command . assert_called_once_with ( 'emit' , expected_command_dict )