Esempio n. 1
0
 def get_data_for_voice(self):
     """
     Prepare OutputData for voicecall.
     Generate the message for an InfoMessage.
     Return VoiceOutputData for sending.
     """
     
     data = VoiceOutputData()
     data.data = self.text
     data.phone_number = self.recipient.phone_number
         
     return data
Esempio n. 2
0
 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)
Esempio n. 3
0
    def get_data_for_voice(self):
        """
        Prepare OutputData for voice.
        Generate the message for an Notification.
        Return VoiceOutputData for sending.
        """
    
        spoken_date = texthelper.date_to_text(self.date.weekday() + 1, \
            self.date.day, self.date.month, self.date.hour, self.date.minute)

        data = VoiceOutputData()
        
        contents = {'date': unicode(spoken_date["date"]),
                    'time' : unicode(spoken_date["time"]),
                    'hospital': self.hospital.name}
                    
        data.data = self.reminder_text(contents, False)
        data.phone_number = self.recipient.phone_number

        return data