Beispiel #1
0
 def test_send_sms_response(self):
     """
     We get the following back from E-scape when we send them an SMS, make
     sure we can parse it correctly"""
     
     html = """
     <table class="widefat" border="0">
         <thead>
             <tr>
                 <th>from</th>
                 <th>to</th>
                 <th>smsc</th>
                 <th>status</th>
                 <th>text</th>
             </tr>
         </thead>
         <tbody>
             <tr>
                 <td>+35566</td>
                 <td>+44778962937</td>
                 <td>ESC-P1Celtel</td>
                 <td>0: Accepted for delivery</td>
                 <td> http://www.mobi-fee.com/link/g.lnk?ID=135</td>
             </tr>
         </tbody>
         <tfoot>
             <tr>
                 <th>from</th>
                 <th>to</th>
                 <th>smsc</th>
                 <th>status</th>
                 <th>text</th>
             </tr>
         </tfoot>
     </table>
     """
     e = E_Scape('api_id')
     [response] = e.parse_response(html)
     self.assertEquals(response.sender, '+35566')
     self.assertEquals(response.recipient, '+44778962937')
     self.assertEquals(response.smsc, 'ESC-P1Celtel')
     self.assertEquals(response.status, ['0', 'Accepted for delivery'])
     self.assertEquals(response.text, ' http://www.mobi-fee.com/link/g.lnk?ID=135')