示例#1
0
    def send(self, sender, recipient, body):
        logging.info("Sms#send, sender = %s, recipient = %s, body = %s", sender, recipient, body)

        if self.settings is None:
            logging.warning("Skipping send as email settings (sms.yml) are missing")
            return

        c = client.Client(self.settings['username'], self.settings['password'])
        c.create_text_message(
            sender=sender,
            recipient=recipient,
            body=body)
        logging.info("Sms#send - completed")
 def setUp(self):
     self._client = client.Client('foo', 'bar', self.BASE_URL)
def test_invalid_url():
    c = client.Client('foo', 'bar', "/this is an invalid URL")
    c.fetch_batch('BATCHID')
def test_client_properties():
    c = client.Client('foo', 'bar', 'http://customurl/', 53.0)
    assert_equal('foo', c.service_plan_id)
    assert_equal('bar', c.token)
    assert_equal('http://customurl/', c.endpoint)
    assert_equal(53.0, c.timeout)
def test_unanswered_request():
    c = client.Client('foo', 'bar', "http://localhost:26541/xms")
    c.fetch_batch('BATCHID')