def test_add_speaker(self):
    self.patch_object(self.c, '_get_remote_address', name='mock__get_remote_address')
    self.mock__get_remote_address.return_value = '1.2.3.4'
    self.patch_object(self.c, 'add_speaker_spec', name='mock_add_speaker_spec')
    self.c.add_speaker('udp', 1024, instance='an-instance', address=None, wait=10, interval=20, send_size=5)
    self.mock__get_remote_address.assert_called_once_with('an-instance', 'udp', 1024)
    self.mock_add_speaker_spec.assert_called_once_with('udp', 1024, '1.2.3.4', wait=10, interval=20, send_size=5)
def test_add_speaker(self):
    self.patch_object(self.c, '_get_remote_address', name='mock__get_remote_address')
    self.mock__get_remote_address.return_value = '1.2.3.4'
    self.patch_object(self.c, 'add_speaker_spec', name='mock_add_speaker_spec')
    self.c.add_speaker('udp', 1024, instance='an-instance', address=None, wait=10, interval=20, send_size=5)
    self.mock__get_remote_address.assert_called_once_with('an-instance', 'udp', 1024)
    self.mock_add_speaker_spec.assert_called_once_with('udp', 1024, '1.2.3.4', wait=10, interval=20, send_size=5)