예제 #1
0
 def test_check_coverage_fail(self):
     clickatell = Clickatell('username', 'password', 'api_id',
                                 client_class=TestClient)
     clickatell.session_id = "session_id"
     clickatell.client.mock('GET', check_coverage_url, {
         'session_id': clickatell.session_id,
         'msisdn': '27123456781'
     }, response=clickatell.client.parse_content(
         'ERR: This prefix is not currently supported. Messages sent to '\
         'this prefix will fail. Please contact support for assistance.'
     ))
     
     resp = clickatell.check_coverage(msisdn='27123456781')
     self.assertTrue(isinstance(resp, ERRResponse))
     self.assertEquals(resp.value, 
         'This prefix is not currently supported. Messages sent to this '\
         'prefix will fail. Please contact support for assistance.')
예제 #2
0
 def test_check_coverage(self):
     clickatell = Clickatell('username', 'password', 'api_id',
                                 client_class=TestClient)
     clickatell.session_id = "session_id"
     clickatell.client.mock('GET', check_coverage_url, {
         'session_id': clickatell.session_id,
         'msisdn': '27123456781'
     }, response=clickatell.client.parse_content(
             'OK:  This prefix is currently supported. Messages sent to ' \
             'this prefix will be routed. Charge: 1'
     ))
     
     resp = clickatell.check_coverage(msisdn='27123456781')
     self.assertTrue(isinstance(resp, OKResponse))
     self.assertEquals(resp.value, 'This prefix is currently supported. '\
                                     'Messages sent to this prefix will '\
                                     'be routed.')
     self.assertEquals(resp.extra['Charge'], '1')