def testBadAppend(self): """ should raise exceptions for wrong appending""" self.improperAppend(twiml.Sms("Hello"))
def smsResponse(msg): r = twiml.Response() r.append(twiml.Sms(msg)) return r
def testBody(self): """Test hello world""" r = Response() r.append(twiml.Sms("Hello, World")) r = self.strip(r) self.assertEquals(r, '<?xml version="1.0" encoding="UTF-8"?><Response><Sms>Hello, World</Sms></Response>')
def testActionMethod(self): """ Test the action and method parameters on Sms""" r = Response() r.append(twiml.Sms("Hello", method="POST", action="example.com?id=34&action=hey")) r = self.strip(r) self.assertEquals(r, '<?xml version="1.0" encoding="UTF-8"?><Response><Sms action="example.com?id=34&action=hey" method="POST">Hello</Sms></Response>')
def testEmpty(self): """Test empty sms verb""" r = Response() r.append(twiml.Sms("")) r = self.strip(r) self.assertEquals(r, '<?xml version="1.0" encoding="UTF-8"?><Response><Sms /></Response>')