def testSendEmail(self): """ Tests to see if we can send an email successfully """ #Todo: Read test information from file with open('../credentials.txt') as f: username, password = f.readline().rstrip('\n'), f.readline().rstrip('\n') messageClient = messageHandler(username, password) self.assertEquals(messageClient.sendEmailMessage('*****@*****.**', 'Test Email', 'Hello World!'), {})
def testSendEmail(self): """ Tests to see if we can send a text message successfully """ #Todo: Read test information from file with open('../credentials.txt') as f: username, password = f.readline().rstrip('\n'), f.readline().rstrip('\n') messageClient = messageHandler(username, password) self.assertEquals(messageClient.sendTextMessage('4087057358', 'AT&T', 'Hello World!'), {})
def main(): zipCode, receiveTexts, recipientEmail = promptUserForLocation() username, password = getUsernameAndPassword('credentials.txt') messageClient = messageHandler(username, password) todaysWeather = getWeather(zipCode) if receiveTexts: recipients = populateListOfRecipients('recipients.txt') for recipient in recipients: messageClient.sendTextMessage(recipient['number'], recipient['gateway'], todaysWeather) else: messageClient.sendEmailMessage(recipientEmail, todaysWeather)