From 06413828a9b9d1460e8853d9b012e608a0412eac Mon Sep 17 00:00:00 2001 From: Mike Lim Date: Wed, 14 May 2014 01:22:00 -0400 Subject: [PATCH] add test client and mock cast library --- libsmscast.py | 2 +- mocksmscast.py | 7 +++++++ testclient.py | 5 +++++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 mocksmscast.py create mode 100644 testclient.py diff --git a/libsmscast.py b/libsmscast.py index 740f761..9f10aed 100644 --- a/libsmscast.py +++ b/libsmscast.py @@ -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, diff --git a/mocksmscast.py b/mocksmscast.py new file mode 100644 index 0000000..13b8a21 --- /dev/null +++ b/mocksmscast.py @@ -0,0 +1,7 @@ +class LibSMSCast: + def __init__(self): + pass + def send(self, to, msg): + for recipient in to: + print("\"{}\" -> {}".format(msg, recipient)) + diff --git a/testclient.py b/testclient.py new file mode 100644 index 0000000..51f70b5 --- /dev/null +++ b/testclient.py @@ -0,0 +1,5 @@ +from mocksmscast import LibSMSCast + +client = LibSMSCast() + +client.send(['test number'], "hello world")