Skip to main content

Foneworx XML API library

Project description

Twisted based library for interacting with Foneworx.co.za’s XML API

Methods implemented

  • Login
  • Logout
  • NewMessages
  • DeleteNewMessages
  • SendMessages
  • SentMessages
  • DeleteSentMessages

Usage:

It runs in Twisted, uses Trial for unittests.

$ virtualenv --no-site-packages ve
$ source ve/bin/activate

Run the client tests, the responses for these are mocked and do not need a Foneworx account set up.

(ve)$ trial tests.client_tests

Run the connection tests, these tests do actually connect to Foneworx to send & receive SMSs. Running these tests will cost you money / SMS credits.

(ve)$ MSISDN=+27xxx USERNAME=xxx PASSWORD=xxx trial tests.connection_tests

Part of the tests is a full stack: receive, reply, delivery report & delete.

(ve)$ USERNAME=xxx PASSWORD=xxx trial \
> tests.connection_tests.FoneworxConnectionTestCase.test_full_stack
tests.connection_tests
  FoneworxConnectionTestCase
    test_full_stack ... Please send a test SMS to Foneworx in order to fill the inbox.
Checking for new SMSs every 2 seconds
Checking for new SMSs every 2 seconds
Checking for new SMSs every 2 seconds
Checking for new SMSs every 2 seconds
Replying to an SMS received from +27xxxxxxxxx
Waiting until delivered
Not delivered yet: At Network
Not delivered yet: At Network
Not delivered yet: At Network
Delivered!
Deleting the received message
Deleted: Success
Deleting the sent message
Deleted: None
Logging out
Logged out: Success
                                           [OK]

--------------------------------------------------
Ran 1 tests in 51.191s

PASSED (successes=1)

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python-foneworx-0.1.tar.gz (10.4 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page