add test client and mock cast library

This commit is contained in:
Vivian Lim 2014-05-14 01:22:00 -04:00
parent 0f526a5543
commit 06413828a9
3 changed files with 13 additions and 1 deletions

View File

@ -7,7 +7,7 @@ class LibSMSCast:
def __init__(self):
self.client = TwilioRestClient(config.ACCOUNT_SID, config.AUTH_TOKEN)
def send(to, msg):
def send(self, to, msg):
for recipient in to:
self.client.messages.create(
to=recipient,

7
mocksmscast.py Normal file
View File

@ -0,0 +1,7 @@
class LibSMSCast:
def __init__(self):
pass
def send(self, to, msg):
for recipient in to:
print("\"{}\" -> {}".format(msg, recipient))

5
testclient.py Normal file
View File

@ -0,0 +1,5 @@
from mocksmscast import LibSMSCast
client = LibSMSCast()
client.send(['test number'], "hello world")