コード例 #1
0
ファイル: test_sms_sender.py プロジェクト: panico/MISO-4101-2
 def test_from_number_OK(self):
     my_sms_client = SenderSMS(self.DEFAULT_SENT_FROM_NUMBER,
                               self.DEFAULT_TESTING_MODE)
     response = my_sms_client.send_sms("::: test_from_number_OK",
                                       self.DEFAULT_SENT_TO_NUMBER)
     self.assertIsNotNone(response)
     self.assertIsNotNone(response.sid)
コード例 #2
0
 def test_from_number_OK(self):
     my_sms_client = SenderSMS(self.DEFAULT_SENT_FROM_NUMBER,
                               self.DEFAULT_TESTING_MODE)
     response = my_sms_client.send_sms("::: test_from_number_OK",
                                       self.DEFAULT_SENT_TO_NUMBER)
     self.assertIsNotNone(response)
     self.assertIsNotNone(response.sid)
コード例 #3
0
ファイル: test_sms_sender.py プロジェクト: panico/MISO-4101-2
	def test_to_number_incapable_to_receiving_sms(self):
		try:
			my_sms_client = SenderSMS(self.DEFAULT_SENT_FROM_NUMBER, self.DEFAULT_TESTING_MODE)
			response = my_sms_client.send_sms("::: test_to_number_in_blacklist", "+15005550009")
		except twilio.TwilioRestException as e:
			self.assertRaises(twilio.TwilioRestException)
			self.assertEqual(21614, e.code)
コード例 #4
0
ファイル: test_sms_sender.py プロジェクト: panico/MISO-4101-2
	def test_to_number_invalid_permissions(self):
		try:
			my_sms_client = SenderSMS(self.DEFAULT_SENT_FROM_NUMBER, self.DEFAULT_TESTING_MODE)
			response = my_sms_client.send_sms("::: test_to_number_invalid_permissions", "+15005550003")
		except twilio.TwilioRestException as e:
			self.assertRaises(twilio.TwilioRestException)
			self.assertEqual(21408, e.code)
コード例 #5
0
ファイル: test_sms_sender.py プロジェクト: panico/MISO-4101-2
	def test_to_number_cant_be_routed(self):
		try:
			my_sms_client = SenderSMS(self.DEFAULT_SENT_FROM_NUMBER, self.DEFAULT_TESTING_MODE)
			response = my_sms_client.send_sms("::: test_to_number_cant_be_routed", "+15005550002")
		except twilio.TwilioRestException as e:
			self.assertRaises(twilio.TwilioRestException)
			self.assertEqual(21612, e.code)
コード例 #6
0
ファイル: test_sms_sender.py プロジェクト: panico/MISO-4101-2
	def test_from_number_sms_queue_full(self):
		try:
			my_sms_client = SenderSMS("+15005550008", self.DEFAULT_TESTING_MODE)
			response = my_sms_client.send_sms("::: test_from_number_sms_queue_full", self.DEFAULT_SENT_TO_NUMBER)
		except twilio.TwilioRestException as e:
			self.assertRaises(twilio.TwilioRestException)
			self.assertEqual(21611, e.code)
コード例 #7
0
ファイル: test_sms_sender.py プロジェクト: panico/MISO-4101-2
	def test_from_number_not_owned_in_my_account(self):
		try:
			my_sms_client = SenderSMS("+15005550007", self.DEFAULT_TESTING_MODE)
			response = my_sms_client.send_sms("::: test_from_number_not_owned_in_my_account", self.DEFAULT_SENT_TO_NUMBER)
		except twilio.TwilioRestException as e:
			self.assertRaises(twilio.TwilioRestException)
			self.assertEqual(21606, e.code)
コード例 #8
0
 def test_to_number_in_blacklist(self):
     try:
         my_sms_client = SenderSMS(self.DEFAULT_SENT_FROM_NUMBER,
                                   self.DEFAULT_TESTING_MODE)
         response = my_sms_client.send_sms(
             "::: test_to_number_in_blacklist", "+15005550004")
     except twilio.TwilioRestException as e:
         self.assertRaises(twilio.TwilioRestException)
         self.assertEqual(21610, e.code)
コード例 #9
0
 def test_to_number_invalid_permissions(self):
     try:
         my_sms_client = SenderSMS(self.DEFAULT_SENT_FROM_NUMBER,
                                   self.DEFAULT_TESTING_MODE)
         response = my_sms_client.send_sms(
             "::: test_to_number_invalid_permissions", "+15005550003")
     except twilio.TwilioRestException as e:
         self.assertRaises(twilio.TwilioRestException)
         self.assertEqual(21408, e.code)
コード例 #10
0
 def test_from_number_invalid(self):
     try:
         my_sms_client = SenderSMS("+15005550001",
                                   self.DEFAULT_TESTING_MODE)
         response = my_sms_client.send_sms("::: test_from_number_invalid",
                                           self.DEFAULT_SENT_TO_NUMBER)
     except twilio.TwilioRestException as e:
         self.assertRaises(twilio.TwilioRestException)
         self.assertEqual(21212, e.code)
コード例 #11
0
 def test_from_number_not_owned_in_my_account(self):
     try:
         my_sms_client = SenderSMS("+15005550007",
                                   self.DEFAULT_TESTING_MODE)
         response = my_sms_client.send_sms(
             "::: test_from_number_not_owned_in_my_account",
             self.DEFAULT_SENT_TO_NUMBER)
     except twilio.TwilioRestException as e:
         self.assertRaises(twilio.TwilioRestException)
         self.assertEqual(21606, e.code)