@@ -12,6 +12,7 @@ def improperAppend(self, verb):
12
12
self .assertRaises (twilio .TwilioException , verb .append , twilio .Play ("" ))
13
13
self .assertRaises (twilio .TwilioException , verb .append , twilio .Record ())
14
14
self .assertRaises (twilio .TwilioException , verb .append , twilio .Hangup ())
15
+ self .assertRaises (twilio .TwilioException , verb .append , twilio .Reject ())
15
16
self .assertRaises (twilio .TwilioException , verb .append , twilio .Redirect ())
16
17
self .assertRaises (twilio .TwilioException , verb .append , twilio .Dial ())
17
18
self .assertRaises (twilio .TwilioException , verb .append , twilio .Conference ("" ))
@@ -213,6 +214,27 @@ def testBadAppend(self):
213
214
""" should raise exceptions for wrong appending"""
214
215
self .improperAppend (twilio .Hangup ())
215
216
217
+
218
+ class TestReject (TwilioTest ):
219
+
220
+ def testReject (self ):
221
+ """should be a Reject with default reason"""
222
+ r = twilio .Response ()
223
+ r .append (twilio .Reject ())
224
+ r = self .strip (r )
225
+ self .assertEquals (r , '<Response><Reject/></Response>' )
226
+
227
+ def testRejectConvenience (self ):
228
+ """should be a Reject with reason Busy"""
229
+ r = twilio .Response ()
230
+ r .addReject (reason = 'busy' )
231
+ r = self .strip (r )
232
+ self .assertEquals (r , '<Response><Reject reason="busy"/></Response>' )
233
+
234
+ def testBadAppend (self ):
235
+ """ should raise exceptions for wrong appending"""
236
+ self .improperAppend (twilio .Reject ())
237
+
216
238
class TestSms (TwilioTest ):
217
239
218
240
def testEmpty (self ):
0 commit comments