-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixing import errors, setup testing, better response documented
- Loading branch information
Showing
15 changed files
with
215 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class NoMessageRecipients(Exception): | ||
""" | ||
Raised when Message Recipients are not specified. | ||
""" | ||
pass | ||
|
||
class InvalidAmount(Exception): | ||
""" | ||
Raised when an invalid currency amount is specified | ||
""" | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
[ | ||
{ | ||
"query": { | ||
"query_result": { | ||
"status": "Success", | ||
"function": "Airtime balance", | ||
"amount": "20.00" | ||
}, | ||
"query_status": "DONE", | ||
"query_code": "D0005" | ||
} | ||
}, | ||
{ | ||
"query": { | ||
"query_result": { | ||
"status": "Success", | ||
"function": "Wallet transfer", | ||
"amount": "1", | ||
"to": "25911000000" | ||
}, | ||
"query_status": "DONE", | ||
"query_code": "D0002" | ||
} | ||
}, | ||
{ | ||
"query": { | ||
"query_result": { | ||
"status": "Success", | ||
"function": "SignUp", | ||
"signup_status": "Registered", | ||
"identity": "0123456789", | ||
"password": "9876543210", | ||
"appkey": "abcdefghijklmnopqrst" | ||
}, | ||
"query_status": "DONE", | ||
"query_code": "D0017" | ||
} | ||
}, | ||
{ | ||
"query": { | ||
"query_result": { | ||
"status": [ | ||
"Success", | ||
"Send_SMS" | ||
], | ||
"to": "27110000000", | ||
"sms_id": "000" | ||
}, | ||
"query_status": "DONE", | ||
"query_code": "D0011" | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import tests | ||
|
||
|
||
def run(): | ||
print("Testing airtime...") | ||
tests.test_airtime() | ||
print("Testing b2c...") | ||
tests.test_b2c() | ||
print("Testing wallet...") | ||
tests.test_wallet() | ||
print("Testing signup...") | ||
tests.test_signup() | ||
print("Testing sms...") | ||
tests.test_sms() | ||
print("DONE") | ||
|
||
|
||
if __name__ == "__main__": | ||
run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from .test_airtime import test_airtime | ||
from .test_b2c import test_b2c | ||
from .test_wallet import test_wallet | ||
from .test_signup import test_signup | ||
from .test_sms import test_sms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from sms import parse_xml_response | ||
from airtime import SAMPLE | ||
|
||
|
||
def test_airtime(): | ||
print(parse_xml_response(SAMPLE)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from sms import parse_xml_response | ||
from b2c import SAMPLE | ||
|
||
|
||
def test_b2c(): | ||
print(parse_xml_response(SAMPLE)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from sms import parse_xml_response | ||
from signup import SAMPLE | ||
|
||
|
||
def test_signup(): | ||
print(parse_xml_response(SAMPLE)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from sms import parse_xml_response | ||
from sms import SAMPLE | ||
|
||
|
||
def test_sms(): | ||
print(parse_xml_response(SAMPLE)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from sms import parse_xml_response | ||
from wallet import SAMPLE | ||
|
||
|
||
def test_wallet(): | ||
print(parse_xml_response(SAMPLE)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters