def test_send_voiceoutputobject(self): phone_number = "1234" data = "test" voicecalldata = VoiceOutputData() voicecalldata.phone_number = phone_number voicecalldata.data = data def conduct_call1(self, number, text, context): #use class variables because of contextbinding to VoiceOutputData OutputTest.phone_number_value = number OutputTest.text_value = text conduct_call_old = voicecall.Voicecall.conduct_call voicecall.Voicecall.conduct_call = conduct_call1 voicecalldata.send() voicecall.Voicecall.conduct_call = conduct_call_old self.assertEquals(self.text_value, data) self.assertEquals(self.phone_number_value, phone_number)