def test_sendgrid_restapi(self): """ Tests send email via SendGrid services """ with app.test_client() as c: rv = c.post('/sendmail', json={ "service_provider": "SENDGRID", "sender": "*****@*****.**", "recipient": "*****@*****.**", "subject": " REST API testing for SendGrid ", "body": "<br><br> <b>Mail test</b>" }) print("RESPONSE CODE ", rv.status_code, " END ") self.assertEquals(rv.status_code, 201)
def test_awsses_restapi(self): """ Tests send email via AWS SES services """ with app.test_client() as c: rv = c.post('/sendmail', json={ "service_provider": "AWSSES", "sender": "*****@*****.**", "recipient": "*****@*****.**", "subject": " AWS REST API TEST", "body": "<br><br> <b>Testing AWS SES REST Api </b>" }) print("RESPONSE CODE ", rv.status_code, " END ") self.assertEquals(rv.status_code, 201)
def test_mailgun_restapi_sgsend(self): """ Tests send email via SENDGRID services """ with app.test_client() as c: rv = c.post('http://127.0.0.1:8000/sendmail', json={ "service_provider": "SENDGRID", "sender": "*****@*****.**", "recipient": "*****@*****.**", "subject": "SENDGRID Cloud Unittest REST ", "body": "<br><br> <b> REST AWSSES From Unittest Api </b>" }) print("RESPONSE CODE ", rv.status_code, " END ") self.assertEquals(rv.status_code, 201)
def test_mailgun_restapi_mailgunsend(self): """ Tests send email via MAILGUN services """ with app.test_client() as c: rv = c.post('http://127.0.0.1:8000/sendmail', json={ "service_provider": "MAILGUN", "sender": "*****@*****.**", "recipient": "*****@*****.**", "subject": " REST TESTING USING UNIT TEST", "body": "<br><br> <b>MAILGUN REST API SEND TEST Api </b>" }) print("RESPONSE CODE ", rv.status_code, " END ") self.assertEquals(rv.status_code, 201)